Just another Perl shrine | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Why does he say it is bad behaviour ?
okay, I have to admit that some compilers 'n stuff are not that smart and start allocing and de-allocing variables right aways when out of scope (not so handy when you're redeclaring IN a loop that runs a million times or so) But, initialising a new var in the while of the loop is not that bad I think, it's just local to the loop, declared once, and out of scope out of your loop... works for me.. By the way... while (my $Var) is NOT initialising, $Var is allocated as undef, then processed by the while, verified as not true, and the code in the while will never run But then again... what do I know.... In reply to Re: redeclaring variables with 'my'
by ChOas
|
|