|
|
|
Your skill will accomplish what the force of many cannot |
|
| PerlMonks |
Re: Re: opening a file destroys nulling entries in a list?!?!by IlyaM (Parson) |
| on Aug 07, 2003 at 07:15 UTC ( #281778=note: print w/ replies, xml ) | Need Help?? |
|
Somehow, the aliasing of the input to $_ is getting mixd up with the first element of @_ When you do screwed($_) variable $_ gets aliased to $_[0] inside screwed() as subroutine parameters always aliased to elements of @_ array inside the subroutine. So later when while loop modifies $_ it affects $_[0] too. Shorter demo: Yet another example why I think while(<>) { ... } considered harmful.
--
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||