Created
July 20, 2012 10:12
-
-
Save oogatta/3149996 to your computer and use it in GitHub Desktop.
perl hash slice
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my %testhash = ( | |
test => 1, | |
hoge => 2, | |
fuga => 3, | |
); | |
# 5.8.9:○ / 5.10.1:× | |
eval { | |
print @{%testhash}{qw/test hoge fuga/}; | |
print "\n"; | |
}; | |
# 5.8.9:○ / 5.10.1:○ | |
eval { | |
print @testhash{qw/fuga hoge test/}; | |
print "\n"; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment