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";