my $file = <IN>
reads in the first line of the file. You can just
print $file;
and be done. Instead, you split the line on newlines (there can't be more than one) and assign the result to an array. And, you repeat this for each line of the file (that's why you get the whole file on the output). I'm not able to get the uninitialized warning.
Update: The warning means the line was empty, therefore there was nothing to split it into.
In reply to Re: Cannot print line
by choroba
in thread Cannot print line
by nimpoura
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |