- or download this
my $stuff = 'file.txt';
open(F, "$stuff") || die "Can not open file: $!\n";
...
print "@records\n";
s/lastlineofdata//; #This is the part I am struggling with
close(F);
- or download this
use strict;
use warnings;
...
print $out_fh, @records;
$out_fh->close;
- or download this
perl -pi -e 'last if eof()' file.txt