Keep It Simple, Stupid | |
PerlMonks |
Re: Using eval: $@ isn't returning the error I expectby haj (Vicar) |
on Feb 19, 2020 at 23:01 UTC ( [id://11113198]=note: print w/replies, xml ) | Need Help?? |
The reason why this fails is that use statements are always evaluated at compile time, even if in a conditional. You could just drop the unless line because if the eval succeeds, then the module is actually loaded. However, in such a situation I'd just add my own dummy cPanelUserConfig somewhere into my include path and get rid of that ugly string eval in production which would silently hide any errors in the real cPanelUserConfig module.
In Section
Seekers of Perl Wisdom
|
|