From: imiyazaki Date: Fri, 7 Nov 2003 16:09:46 +0000 (+0000) Subject: support 5.8.1 only. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea12590c30aae0ff41532df8ba192b7158f0a871;p=chise%2Fperl.git support 5.8.1 only. --- diff --git a/Chise_utils/scripts/sample.pl b/Chise_utils/scripts/sample.pl index a287ab2..a27b227 100644 --- a/Chise_utils/scripts/sample.pl +++ b/Chise_utils/scripts/sample.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl -w -CSD use Getopt::Long; use strict; @@ -9,6 +9,7 @@ use vars qw($atr $value $char $opt_help ); use Chise_utils ':all'; +require 5.008001; my $usage=< | --map | @@ -24,23 +25,23 @@ Usage: perl $0 [-m | --map | ex. of total-strokes==8 means the attribute of total-strokes exactly matches to 8. - ids-parts=~矢 means - the attribute of ids-parts contains the string 矢. - total-strokes==8,ids-parts=~矢 means both at the same time. + ids-parts=‾ø½‹§‚ï½¢ means + the attribute of ids-parts contains the string ø½‹§‚ï½¢. + total-strokes==8,ids-parts=‾ø½‹§‚ï½¢ means both at the same time. -a get of -aa get all attributes of EOF -&GetOptions("mapto=s"=>\$opt_mapto, - "mapfrom=s"=>\$opt_mapfrom, - "m=s"=>\$opt_map, - "r=s"=>\$opt_rev_map, - "a=s"=>\$opt_atr, - "aa"=>\$opt_allatr, - "show-attribute"=>\$opt_showatr, - "q"=>\$opt_query, - "help",\$opt_help, - "h",\$opt_help); +&GetOptions("mapto=s"=>Â¥$opt_mapto, + "mapfrom=s"=>Â¥$opt_mapfrom, + "m=s"=>Â¥$opt_map, + "r=s"=>Â¥$opt_rev_map, + "a=s"=>Â¥$opt_atr, + "aa"=>Â¥$opt_allatr, + "show-attribute"=>Â¥$opt_showatr, + "q"=>Â¥$opt_query, + "help",Â¥$opt_help, + "h",Â¥$opt_help); if($opt_help or !((($opt_map or $opt_rev_map or $opt_mapfrom or $opt_mapto) and @ARGV==0) @@ -65,44 +66,44 @@ if($opt_map){ if(&get_db($opt_map)){ foreach $char (sort keys %{$chardb{$opt_map}}){ if($chardb{$opt_map}->{$char}){ - print $char,"\t",$chardb{$opt_map}->{$char},"\n"; + print $char,"Â¥t",$chardb{$opt_map}->{$char},"Â¥n"; } } }else{ - print STDERR "No map for $opt_map.\n"; + print STDERR "No map for $opt_map.Â¥n"; } }elsif($opt_rev_map){ if(&get_reverse_db($opt_rev_map)){ foreach $char (sort keys %{$reverse_chardb{$opt_rev_map}}){ if($reverse_chardb{$opt_rev_map}->{$char}){ - print $char,"\t",$reverse_chardb{$opt_rev_map}->{$char},"\n"; + print $char,"Â¥t",$reverse_chardb{$opt_rev_map}->{$char},"Â¥n"; } } }else{ - print STDERR "No map for $opt_rev_map.\n"; + print STDERR "No map for $opt_rev_map.Â¥n"; } }elsif($opt_allatr){ - print $char,"\n"; + print $char,"Â¥n"; foreach $atr (sort keys %db){ if($value=&get_char_attribute($char,$atr)){ - print " ",$atr,":",$value,"\n"; + print " ",$atr,":",$value,"Â¥n"; } } }elsif($opt_atr){ - print $char,"\n"; - print " ",$opt_atr,":",&get_char_attribute($char,$opt_atr),"\n"; + print $char,"Â¥n"; + print " ",$opt_atr,":",&get_char_attribute($char,$opt_atr),"Â¥n"; }elsif($opt_showatr){ -# print "In DB\n"; +# print "In DBÂ¥n"; foreach $atr (sort keys %db){ - print " ",$atr,"\n"; + print " ",$atr,"Â¥n"; } -# print "In reverse DB\n"; +# print "In reverse DBÂ¥n"; # foreach $atr (sort keys %reverse_db){ -# print " ",$atr,"\n"; +# print " ",$atr,"Â¥n"; # } }elsif($opt_query){ my $query=$char; - print join "\n",&get_chars_for($query),"\n"; + print join "Â¥n",&get_chars_for($query),"Â¥n"; } exit 0;