Mega Code Archive
Read only the last file line from a text file
#!/usr/bin/perl -w
# tail2.pl
use strict;
open(FILE, '<', 'yourFile.txt') or die $!;
my @speech = ; # slurp the whole file into memory
close FILE;
print "Last five lines:\n", @speech[-5 .. -1];