Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Using 'use' away from script start

by MZSanford (Curate)
on Nov 15, 2001 at 14:28 UTC ( [id://125542]=note: print w/replies, xml ) Need Help??


in reply to Using 'use' away from script start

All of this, and require goes unloved. :(

In the spirit of KISS, and also guessing that if loading LWP::Simple is too much a performance penalty, i can't imagine Autoloader will be well recieved, i put forward something like this :
sub once_in_a_blue_moon { require LWP::Simple; my $page = get('http://www.yahoo.com'); }

please note, i suggest use'ing the module at the top to improve readability, as i think that will be more important in the long run that the minor gain of not loading LWP::Simple.
i had a memory leak once, and it ruined my favorite shirt.

Replies are listed 'Best First'.
Re: Re: Using 'use' away from script start
by mischief (Hermit) on Nov 15, 2001 at 19:34 UTC
    Have a look at the first reply here, MZSanford, you'll see that require is getting plenty of lovin'.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2025-02-14 08:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found