Displaying the contents of a hash
Perl 5:
for (keys %h) {
print "$_ = $h{$_}\n";
}
Perl 6:
say ~%h; .say for %h;
| Perl 6 | Perl 6 today | #20 |
Perl 5:
for (keys %h) {
print "$_ = $h{$_}\n";
}
Perl 6:
say ~%h; .say for %h;
|
Copyright © 2009 http://www.pmichaud.com/2009/pres/ |