我在Perl的初学者,我试图从“开始的Perl:柯蒂斯坡”运行这个样本例如行为无法理解Perl散列的订货
#!/perl/bin/perl
use strict;
use warnings;
use diagnostics;
my $hero = 'Ovid';
my $fool = $hero;
print "$hero isn't that much of a hero. $fool is a fool.\n";
$hero = 'anybody else';
print "$hero is probably more of a hero than $fool.\n";
my %snacks = (
stinky => 'limburger',
yummy => 'brie',
surprise => 'soap slices',
);
my @cheese_tray = values %snacks;
print "Our cheese tray will have: ";
for my $cheese (@cheese_tray) {
print "'$cheese' ";
}
print "\n";
上面的代码的输出,当我试图在我的activeperl与Windows7系统和codepad.org
Ovid isn't that much of a hero. Ovid is a fool.
anybody else is probably more of a hero than Ovid.
Our cheese tray will have: 'limburger''soap slices''brie'
我不跟三线清晰,其打印“limburger''soap slices''brie”,但哈希顺序是有“limburger''brie””肥皂片“。
请帮我理解。