Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Conditional loading of methods

by jasonk (Parson)
on Dec 09, 2008 at 04:33 UTC ( [id://729079]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    eval "use Foo::Bar";
    
    eval <<"END" unless $@;
    sub my_method { # Code }
    END
    
  2. or download this
    eval "use Foo::Bar";
    if ( $@ ) {
    ...
    } else {
        require "dont-have-foo-bar-library.pl";
    }
    
  3. or download this
    eval { require Foo::Bar; import Foo::Bar; }
    

Log In?
Username:
Password:

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

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

    No recent polls found