You could chomp @$array outside the loop which has the same effect as the chomp inside the loop but makes it obvious that that is happening. $line is aliased to each element of @$array so the contents of @$array is altered by the loop in any case.
In reply to Re: chomp - reference
by GrandFather
in thread chomp - reference
by michaelp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |