Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

How to use 'require' properly?

by flexvault (Monsignor)
on Sep 28, 2015 at 04:30 UTC ( #1143195=perlquestion: print w/replies, xml ) Need Help??

flexvault has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

This is related to stevieb's question and his desire to use 'require' for seldom used modules:

    Where in a package should 'use' be called?

I have used the following:
use ... qw( ... );
but when I use 'require', it doesn't let me select the subroutines I need for execution. If the default doesn't include what I need, then the script fails at execution time.

Is there a better way to use 'require' or am I using 'require' incorrectly?

Regards...Ed

"Well done is better than well said." - Benjamin Franklin

Replies are listed 'Best First'.
Re: How to use 'require' properly?
by Athanasius (Bishop) on Sep 28, 2015 at 04:43 UTC
Re: How to use 'require' properly?
by sundialsvc4 (Abbot) on Sep 28, 2015 at 14:14 UTC

    Also handy is UNIVERSAL::require.   The DESCRIPTION section of this Perldoc says it all.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1143195]
Approved by Athanasius
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2020-09-19 04:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (114 votes). Check out past polls.

    Notices?