Perl-Sensitive Sunglasses | |
PerlMonks |
Why will referencing an undefined value as array reference create a real arrayby mfort (Novice) |
on Jun 18, 2014 at 18:45 UTC ( [id://1090329]=perlquestion: print w/replies, xml ) | Need Help?? |
mfort has asked for the wisdom of the Perl Monks concerning the following question:
Script:
Output: In a larger script, $test will either be undef or will be a reference to an array of data, where the first element is an array reference. I would have expected 'scalar' to examine only, not create an anonymous array. So what is the logic employed by perl?
Back to
Seekers of Perl Wisdom
|
|