Note: you'll need an 'import' in there if you also want to import exported methods etc.my $loaded; { # ignore warnings if subs are being redefined local $^W = 0; $loaded = eval "require MQSeries"; } if(!defined($loaded)) { print "Can't load MQSeries: $@\n"; }
update: Apparently 'use' does work in 'eval', I can't for the life of me remember why I thought you can't, must have been some reason that I use require.. hohum..
C.
In reply to Re: Optional modules?
by castaway
in thread Optional modules?
by Jeppe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |