Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Optional modules?

by broquaint (Abbot)
on Feb 27, 2003 at 13:06 UTC ( [id://239085]=note: print w/replies, xml ) Need Help??


in reply to Optional modules?

eval { require MQSeries; MQSeries->import; }; $@ and warn $@;
So that will attempt to 'use' MQSeries and warn if it fails. Or as a subroutine
sub cond_use { (my $module = shift().".pm") =~ s<::></>g; eval { require $module; $module->import(@_); }; $@ and warn $@; } cond_use "MQSeries";

HTH

_________
broquaint

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://239085]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-23 06:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found