The script works fine if I use "./<script_name> data_file". But when I hardcode the name of data_file, it doesn't work. I am sure it has something to do with "while (<>)" statement. Can anyone please advice how to proceed when we have datafile name hardcoded, and it is read in an array and then.......???
I personally believe that you should get familiar with some basic Perl: then you wouldn't be asking such an embarassingly trivial question. Anyway, here's your fish - you either want
and then you would use while (<$fh>) instead of while (<>), oropen my $fh, '<', $data_file or die "Can't open `$data_file': $!\n";
@ARGV='data_file';
In reply to Re^3: How to swap rows with columns? - Still unresolved :(
by blazar
in thread How to swap rows with columns? - Still unresolved :(
by perl_geek
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |