in reply to Question on File Handler and Subroutines in Perl
If you look at this:
while (my $line = <FILE>) {
You'll find that $line is now "a.txt\n". It keeps the line break at the end of the line. Look at the chomp function to resolve that.
Also the following line isn't even doing anything:
my $file = scalar(@_);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Question on File Handler and Subroutines in Perl
by Anonymous Monk on Mar 06, 2019 at 02:08 UTC | |
by hippo (Archbishop) on Mar 06, 2019 at 09:01 UTC |