use File::CounterFile; use CGI qw(:all); print header('text/plain'), File::CounterFile->new("/path/to/file")->inc;