so close ... so close
my $file = 'oratabtest.txt' open FILE, "< $file" or die; my @lines = <FILE>; open FILE, "> $file" or die;
Now the question is not how to get the last line of a file but the last element of an array (since you slurped the whole file into @lines).
In reply to Re: Grab last line and print
by derby
in thread Grab last line and print
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |