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

Re: Re: using 'use' conditionally (require instead of use)

by BUU (Prior)
on Nov 05, 2002 at 01:17 UTC ( #210362=note: print w/replies, xml ) Need Help??


in reply to Re: using 'use' conditionally (require instead of use)
in thread using 'use' conditionally

Why bother evaling? Just do if($opt_g){require Tk;}

Replies are listed 'Best First'.
Re: Re: Re: using 'use' conditionally (require instead of use)
by chromatic (Archbishop) on Nov 05, 2002 at 05:48 UTC

    What if the require fails?

      Then you can't run with the -g mode and the user gets a good explanation as to why. I agree with BUU, drop the eval entirely.

              - tye

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2022-05-29 01:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (101 votes). Check out past polls.

    Notices?