print the $filename after the regex (e.g. into a temp file.) when running this script from the browser.
if the script doesn't get even that far, then something else is wrong (e.g. file permissions OR module not in libpath etc.)....in which case log into the box as the web server user (if you can) and try to execute the cgi script from the command line..........i.e. go back to basics, if you've coded the cgi without first ascertaining that a basic perl cgi works through www
the hardest line to type correctly is: stty erase ^H