Then replace the while loop with this code my @lines = <F>;
open (F, $file) or die "cannot open file"; my @lines = <F>; close F;
you can do the same with perl module File::Slurp
use File::Slurp; my @array = read_file($filename);
In reply to Re^5: File handling basics
by vinoth.ree
in thread File handling basics
by ElectroRed
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |