Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Sorry but 'last line is blank' doesnt wash..by rchiav (Deacon) |
on Sep 10, 2001 at 21:53 UTC ( [id://111521]=note: print w/replies, xml ) | Need Help?? |
Well I'm definately not at the wizard/god level, but I think I might know what's really going on. It's up to others to call it a bug or not. I threw this in a debugger to see what exactly happens where. With this code.. I set a breakpoint upon reaching the suspect line. When it hits the line, the my variable @ary is created. It's empty. This is done before the evaluation of the expression. Unfortunately the debugger I was using won't show the reiteration of that line. But needless to say, when I stepped off that line, @ary was still empty. Next, I used I set the breakpoint on the my declaration. As before, when I hit that line, @ary was created. When I left the line, it contained the last line of text, each word in an array element. What that information, here's my opinion: Each time the line in question is accessed, @ary is redeclared (blank). This even happens when the line is executed just for <DATA> to return false. So the last iteration redeclares @ary, there's no more DATA and the program moves on. Is that a bug? I'll let someone else answer that :) Rich
In Section
Seekers of Perl Wisdom
|
|