open LOG,"<","/some/log" or die $!; seek LOG,-50000,2; # go to 50K from the end (assuming your log-lines have 500 or less characters) my @lines = ; # get all from there splice @lines => 0, -100; # see [Abigail-II]'s comment close LOG; print @lines;