summaryrefslogtreecommitdiff
path: root/bin/japan.pl
diff options
context:
space:
mode:
authorivan <ivan>2009-02-25 20:05:42 +0000
committerivan <ivan>2009-02-25 20:05:42 +0000
commitdae72a4ab1dc0a1afaf8d4f2debb509ade36233c (patch)
tree14001c5776c26924e7757a6dfd65a9c24e83e4da /bin/japan.pl
parent8ce1d87506f8e0439b99496f46763cfc336e6a13 (diff)
adding quick tool to change the "states" for japan
Diffstat (limited to 'bin/japan.pl')
-rwxr-xr-xbin/japan.pl32
1 files changed, 32 insertions, 0 deletions
diff --git a/bin/japan.pl b/bin/japan.pl
new file mode 100755
index 0000000..14e44e4
--- /dev/null
+++ b/bin/japan.pl
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+
+use FS::UID qw( adminsuidsetup );
+use FS::Record qw( qsearch );
+use FS::cust_main_county;
+
+adminsuidsetup shift;
+
+my $country = 'JP';
+
+foreach my $cust_main_county (
+ qsearch('cust_main_county', { 'country' => $country } )
+) {
+
+ if ( $cust_main_county->state =~ /\[([\w ]+)\]\s*$/ ) {
+ $cust_main_county->state($1);
+ my $error = $cust_main_county->replace;
+ die $error if $error;
+ }
+
+}
+
+
+#use Locale::SubCountry;
+#
+##my $state = 'Tôkyô [Tokyo]';
+#my $state = 'Tottori';
+#
+#my $lsc = new Locale::SubCountry 'JP';
+#
+#print $lsc->code($state)."\n";
+