in reply to how can i read only the last line of a files

I think your best bet is to give GrandFather enough information to do something clever, elegant, and efficient. Pending that, here's my contributuion to getting the last line from each of the three files in a fairly basic way.
my $last_line; for my $fname ( 'tax.pl', 'accno.pl', 'ptax.pl' ) { open INFILE, $fname; while (<INFILE>) { chomp; $last_line = $_; } close INFILE; print "$fname:$last_line\n"; $last_line = ''; # in case 2nd or 3rd file is empty }
This will work with huge files, where you don't want to store the whole file in memory, although, by the extensions, I'm guessing your files are fairly short. Also, for huge files, you almost certainly want File::ReadBackwards as davorg has already suggested.