No such thing as a small change | |
PerlMonks |
Re: Re: Re: Getting data out of __DATA__ and __END__by IraTarball (Monk) |
on Sep 10, 2001 at 21:05 UTC ( [id://111510]=note: print w/replies, xml ) | Need Help?? |
I hope this doesn't come out wrong but... Where are people getting this "$_ only happens in a regular while loop stuff? I would like to see a reference. I routinely use one liners like print while (<>). I think this might be confussion with the $_ magic assignment only happens in a while loop when using the <> operator. Can anyone correct me on this? BTW I <e>really</e> liked demerphq's solution. Ugh, Zog say map gooood.
again, I would love to be corrected on this and shown the errors of my ways. I'm a sinner! Ira punnishes his wicked flesh bad, bad flesh. After running some code samples I have no answers but only questions. So clearly the my declaration of array is *not* local to some implicit scope because use strict doesn't complain when you access it later in the file. And so I used the Dump procedure from Devel::Peek and the plot thickened...
Gave me... Note that MAX is 4? When I do this on an empty, never accessed array MAX is -1. So I think that somewhere along the way @array got 4 elements assigned to it. But that's also weird because there should have been 5. Any hubris I had is now confussion. All is lost... all is lost... Ira.
In Section
Seekers of Perl Wisdom
|
|