#!/usr/bin/perl -w $file = "/home/anand/." . `basename $0`; $cmd = "~/xbin/frm /usr/local/www/virtual2/66/175/42/208/anandnatrajan-mail/anand"; open(F, $file); @oldsz = ; close(F); @newsz = `$cmd`; if ($oldsz[0] < ++$#newsz) { system("$cmd | /usr/bin/tail -" . ($#newsz - $oldsz[0])); } open(F, ">$file"); print F $#newsz; close(F);