Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I think you slightly mis-stated the common construct, it should be:
Otherwise the my $var returns undef which might not be what you want (the loop would not be executed). As far as I know this is perfectly kosher. $var is declared, its scope is the inner block and I would bet (Perl guts Gurus can confirm this) that the whole thing is optimized so the variable is actually built (ie allocated) only once. I'd be interested in knowing what are your local guru arguments. In reply to Re: redeclaring variables with 'my'
by mirod
|
|