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

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); }

Replies are listed 'Best First'.
RE: RE: RE: RE: Re: Use of unitialized variable?
by merlyn (Sage) on Aug 29, 2000 at 05:55 UTC
      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 . . .
        Doh! Nope, that one prints it, just like the word says. You want this:
        use strict; use LWP::Simple; print &getHTML('http://www.perlmonks.org'); sub getHTML { return get(shift); }
        which just gets it, just what you want.

        -- Randal L. Schwartz, Perl hacker