|
|
| Perl Monk, Perl Meditation | |
| PerlMonks |
Re: modification of read-only in hash ++by rob_au (Abbot) |
| on Feb 05, 2004 at 09:37 UTC ( #326728=note: print w/ replies, xml ) | Need Help?? |
|
The BEGIN block is executed prior to the definition of the %guid and as such the hash element $guid{218827} is auto-vivified in this code block. The auto-vivified hash element has an undefined value which you are subsequently attempting to increment. For details on the behaviour of BEGIN blocks, see the perlmod man page under the heading "Package Constructors and Destructors". For an explanation of auto-vivification, see perlref, perlfaq4, perlfunc and the node Autovivification by merlyn. Update: Erk, weirder stuff appearing - It almost looks like something weird is happening with closures ...
perl -le "print unpack'N', pack'B32', '00000000000000000000001010111111'"
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||