[SOLVED] Using eval: $@ isn't returning the error I expectby doctormelodious (Acolyte)
|on Feb 19, 2020 at 22:38 UTC||Need Help??|
doctormelodious has asked for the wisdom of the Perl Monks concerning the following question:
EDIT: SOLVED! The eval was not only formatted incorrectly, it needed to be in a BEGIN block, due to the nature of the module's use by the host server. Thanks for all the help!
The host server where our intracompany site lives requires this on one of our CGI scripts:use cPanelUserConfig;
My local machine is running its own Apache server, and I use it to test code. However, it doesn't have cPanelUserConfig installed. It's a pain to have to remember to comment that line out when I'm testing locally and then uncomment it before I upload it to the host server. So I tried this:
The problem is that, even though that Perl module is not installed, $@ is empty, so the "use cPanelUserConfig" tries to execute and the script dies.
Any suggestions for making this work?