I'd like to use a BEGIN block (or something) in a required file to check whether another module's available. If it's not, I'd like to give up processing this file and just return a true value to the require. I'm not really sure how to do it: something like this?
BEGIN { eval "require Maybe::Module"; if ( $@ ) { # don't bother } } # I only want these to be defined if Maybe::Module's available sub foo { ... }
Thanks
ViceRaid
In reply to Aborting loading of file in a BEGIN block by ViceRaid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |