|
|
| P is for Practical | |
| PerlMonks |
The hidden hashrefby nickandrew (Initiate) |
| on May 19, 2010 at 13:03 UTC ( [id://840692] : perlquestion . print w/replies, xml ) | Need Help?? |
|
nickandrew has asked for the wisdom of the Perl Monks concerning the following question: O wise perl monks, Investigating a bizarre problem today, I found some anomalous behaviour in perl.
The script outputs:
Now, "$data->{args}" has been initialised to a scalar empty string. Without using "use strict", perl allows code which treats this like a hashref and stores something in it. The stored data (in this case, a hashref with key stuff and value bother) can't be seen by Data::Dumper but can be retrieved in the same way it was stored. Is this a perl bug? If I "use strict" then my program emits an error. Is this a language feature? I have checked this behaviour in perl 5.6, 5.8 and 5.10. Is it something to do with symbolic references ala "use strict refs" ?
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||