in reply to Using 'use' away from script start
No. use happens at compile time and your example will always use the module. Use this:
sub once_in_a_blue_moon { require LWP::Simple; LWP::Simple->import; my $page = get('http://www.yahoo.com'); }
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|