NAME Parse::JapanesePostalCode - PostalCode Parser for 日本郵政 SYNOPSIS use Parse::JapanesePostalCode; my $parser = Parse::JapanesePostalCode->new( file => 'KEN_ALL.csv' ); while (my $obj = $parser->fetch_obj) { my @list = map { $_ ? $_ : () } ($obj->zip, $obj->pref, $obj->district, $obj->city, $obj->ward, $obj->town); if ($obj->has_subtown) { push @list, join '/', @{ $obj->subtown }; } if ($obj->build) { my $str = $obj->build; $str .= $obj->floor . 'F' if $obj->floor; push @list, $str; } } DESCRIPTION Parse::JapanesePostalCode is a feel good parser to parse to Postal Code files that are provided by Japan Post. Parse::JapanesePostalCode ã¯ã€æ—¥æœ¬éƒµæ”¿ãŒæä¾›ã—ã¦ã„る郵便番å·ãƒ•ã‚¡ã‚¤ãƒ«ã‚’良ã„æ„Ÿã˜ã«ãƒ‘ースã—ã¦ãれるパーサã§ã™ã€‚ METHODS new create to parser instance. read from file path. my $parser = Parse::JapanesePostalCode->new( file => 'foo/bar/KEN_ALL.csv', ); read from file handle. my $parser = Parse::JapanesePostalCode->new( fh => $ken_all_fh, ); ignore katakana_h2z. my $parser = Parse::JapanesePostalCode->new( file => 'foo/bar/KEN_ALL.csv', katakana_h2z => 0, ); ignore alnum_z2h. my $parser = Parse::JapanesePostalCode->new( file => 'foo/bar/KEN_ALL.csv', alnum_z2h => 0, ); get_line get one line from KEN_ALL.csv. while (my $line = $parser->get_line) { say $line; } 1è¡Œèªã¿è¾¼ã¿ã¾ã™ã€‚ã‚‚ã— 07543,"97906","9790622","フクシï¾ï½¹ï¾","フタバグï¾ï¾„ï¾ï½µï½¶ï¾ï¾","ケガヤ(ï¾ï½´ï½¶ï¾œï¾Šï¾—232-244、311、312、337-862バï¾ï¾","ç¦å³¶çœŒ","åŒè‘‰éƒ¡å¯Œå²¡ç”º","毛è±ï¼ˆå‰å·åŽŸï¼’32〜244ã€ï¼“11ã€ï¼“12ã€ï¼“37〜862番地",1,1,0,0,0,0 07543,"97906","9790622","フクシï¾ï½¹ï¾","フタバグï¾ï¾„ï¾ï½µï½¶ï¾ï¾","トウキョウデï¾ï¾˜ï½®ï½¸ï¾Œï½¸ï½¼ï¾ï¾€ï¾žï½²2ゲï¾ï½¼ï¾˜ï½®ï½¸ï¾Šï¾‚デï¾ï½¼ï½®ï½ºï½³ï¾…ï½²)","ç¦å³¶çœŒ","åŒè‘‰éƒ¡å¯Œå²¡ç”º","〔æ±äº¬é›»åŠ›ç¦å³¶ç¬¬äºŒåŽŸå力発電所構内〕)",1,1,0,0,0,0 ã®ã‚ˆã†ã«è¤‡æ•°è¡Œã«åˆ†å‰²ã•ã‚Œã¦ã„ãŸã‚‰ã€è‰¯ã„æ„Ÿã˜ã«è¡Œã‚’マージã—ãŸçµæžœã‚’è¿”ã—ã¾ã™ã€‚ fetch_obj get one line object from KEN_ALL.csv. while (my $obj = $parser->fetch_obj) { say $obj->zip; } get_line ã§å–å¾—ã—ãŸè¡Œã‚’〠Parse::JapanesePostalCode::Row ã§ã‚ªãƒ–ジェクト化ã—ãŸã‚ªãƒ–ジェクトを返ã—ã¾ã™ã€‚ AUTHOR Kazuhiro Osawa <yappo {at} shibuya {dot} pl> SEE ALSO Parse::JapanesePostalCode::Row, <http://www.post.japanpost.jp/zipcode/download.html> LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.