my @args = qw/ perl -i -ne 'print unless eof' filename /; system(@args) == 0 or die "error with deleting last line";