in reply to Grab last line and print
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).
|
|---|