0001 # 0002 # Example of Perl hash 0003 # 0004 my %hero = ( # identifier preceded by % holds a group of values, keyed by string 0005 "ÔƳ¤"=>"¹ØÓð", 0006 "ÒíµÂ"=>"ÕÅ·É", 0007 "×ÓÁú"=>"ÕÔÔÆ", 0008 "ÃÏÆð"=>"Âí³¬" 0009 ); 0010 foreach $style (keys %hero) 0011 { print " ($style,$hero{$style})"; } print "\n"; 0012 $hero{"ººÉý"} = "»ÆÖÒ"; 0013 foreach $style (keys %hero) 0014 { print " ($style,$hero{$style})"; } print "\n"; 0015 foreach $style (sort keys %hero) 0016 { print " ($style,$hero{$style})"; } print "\n"; 0017 foreach $style (reverse sort keys %hero) 0018 { print " ($style,$hero{$style})"; } print "\n";