Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Does a foreach create a scalar reference?by hesco (Deacon) |
on May 26, 2009 at 19:07 UTC ( [id://766278]=perlquestion: print w/replies, xml ) | Need Help?? |
hesco has asked for the wisdom of the Perl Monks concerning the following question:
This works, I just don't understand why. Can anyone please shed some light on why my timestamp elements are affected by my assignment to a locally scoped variable in a while loop? Does this foreach construct make $element a reference to the underlying list element? -- Hugh
This produced output looking like this:
if( $lal && $lol ) { $life++; }
Back to
Seekers of Perl Wisdom
|
|