in reply to (jeffa) RE: Re: Use of unitialized variable?
in thread Use of unitialized variable?

If you use LWP::Simple, you don't end up re-creating the User Agent repeatedly. That'd be a big win.

-- Randal L. Schwartz, Perl hacker

  • Comment on RE: RE: Re: Use of unitialized variable?

Replies are listed 'Best First'.
(jeffa) 4Re: Use of unitialized variable?
by jeffa (Bishop) on Aug 29, 2000 at 05:52 UTC
    Yep, you are right - in my haste I overlooked that each call to sub getHTML instantiates a new agent.
    What a waste!! :0

    One more time:

    use strict; use LWP::Simple; print &getHTML('http://www.perlmonks.org'); sub getHTML($) { my $url = shift; my $content = get($url); return getprint($url); }
        DOH!
        that's what I get for taking the perldoc example too literally without thinking.
        Last time? *wince*
        use strict; use LWP::Simple; print &getHTML('http://www.perlmonks.org'); sub getHTML($) { return getprint(shift); }
        minus error checking, of course . . .