If the script works when you run it at the commandline, it may also be a permissions or path issue. Depending on how the webserver is configured, the "user" that runs the CGI may not know how to find the command "time." I believe those commands are kept down in C:\WINNT\System32 (or something like that) and for security reasons, those paths might not be available to the user running the webservice. Have you looked at the various modules for Time, such as Time::localtime?