the_slycer has asked for the wisdom of the Perl Monks concerning the following question:
This returns something like:#!/usr/bin/perl use warnings; use strict; use Data::Dumper; my $questions = { 1 => { foo => 'bar' }, 2 => { foo => 'bar' }, 3 => { foo => 'bar' } }; print "(before):\n",Dumper($questions),"\n"; for (1 .. 4) { my $foo = $questions->{$_}{foo} || "daklfjsdalk"; } print "(after): \n",Dumper($questions), "\n";
(before):
$VAR1 = {
1 => {
'foo' => 'bar'
},
2 => {
'foo' => 'bar'
},
3 => {
'foo' => 'bar'
}
};
(after):
$VAR1 = {
1 => {
'foo' => 'bar'
},
2 => {
'foo' => 'bar'
},
3 => {
'foo' => 'bar'
},
4 => {}
};
And I'm not sure why, my question is twofold:
|
|---|