#!/usr/bin/perl use strict; use warnings; use CGI; use CGI::Carp qw(fatalsToBrowser); use File::ReadBackwards; my $cgi = CGI->new(); print $cgi->header('text/plain'); 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(); }