in reply to calculate the time taken to run a script

Devel::Timer has the facilities although if it were me I'd be satisfied with just recording the timestamps and calculate the differences later:
#!user/bin/perl # use ... statements system "echo '" . localtime() . ": starting' > /tmp/mycgi.$$"; # .. rest of script system "echo '" . localtime() . ": done' >> /tmp/mycgi.$$";

-M

Free your mind