#!/usr/bin/perl use strict; use warnings; use File::ReadBackwards; my $file = '/path/to/file.txt'; my $frb = File::ReadBackwards->new( 'log_file' ) or die "can't read 'log_file' $!"; for(0..9){ print $frb->readline(); }