use utf8; use strict; use warnings; use Data::Dumper; my %h = (a => 'alfa', b => 'beta'); print "\n\nWorkaround 1 \n"; print map { "\t>>$_<<\n" } "$h{a}", "$h{111}", "$h{b}"; print "after third:\n", Dumper(\%h); print "\n\nWorkaround 2 \n"; print map { "\t>>$h{$_}<<\n" } qw/a 222 b/; print "after third:\n", Dumper(\%h); # print "\n\nWorkaround 3 \n"; # no autovivification; # print map { "\t>>$_<<\n" } $h{a}, $h{333}, $h{b}; # print "after third:\n", Dumper(\%h);
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
In reply to Re^2: Sometimes undef is initialized and sometimes not when hash values are fed to grep
by LanX
in thread Sometimes undef is initialized and sometimes not when hash values are fed to grep
by leszekdubiel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |