What's happening is that the reference to main:: isn't correct, so the path to $file is not correct. Since the path is not correct, the -e file test returns false. The call to &main::Error is unable to find sub Error and leaves this message in the error log: "Undefined subroutine &main::Error called at /home/username/safe/pm/Custom/Template.pm line 32"

sub Error is exported into package main properly, and this system works fine when run as a CGI script.

I'm guessing that the problem is the reference to main::, when in fact it's probably the Apache handler subroutine which is in main and my "main" script is in some other package. Any suggestions? Thanks.

>> If you can't control it, improve it, correlate it or disseminate it with PERL, it doesn't exist!