Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Best/possible ways to dynamically use modules

by chipmunk (Parson)
on Dec 18, 2001 at 09:21 UTC ( [id://132791]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if ($use_socket) {
      use Socket;         # oops!  Socket will get loaded at compile-time
                          # before $use_socket is even evaluated
    }
    
  2. or download this
    if ($use_socket) {
      eval "use Socket";  # ok: Socket gets loaded at run-time
                          # if $use_socket is true
    }
    
  3. or download this
    if ($use_socket) {
      require Socket;     # ok: Socket gets loaded at run-time
      Socket->import();   # if $use_socket is true
    }
    
  4. or download this
    if ($use_socket) {
      require Socket;
      Socket->export_to_level(1, @_);
    }
    

Log In?
Username:
Password:

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

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

    No recent polls found