On Mon, Feb 25, 2002 at 02:29:58PM +1030, Daniel Falkenberg wrote:
> my $content = $response->content;
> $p = HTML::TokeParser->new($content) || die "Can't open: $!";
> while ($stream->get_tag("h1")) { $data = get_trimmed_text("/h1");}

To start with, I think I'd use LWP::Simple.  It saves a lot of hassle.

use LWP::Simple;
$content = get($address) or die;

... would work to stick the HTML from $address in $content.

There's also an error in the above.  You're creating an instance of
TokeParser as $p, and then calling the 'get_tag' method on _$stream_,
which you haven't used before.  I used $stream in my original code
example; because I prefer variables that mean something, and that's how
I like to think of the TokeParser object.

Changing $stream to $p (or changing your instance of TokeParser to
$stream) should fix things.  I'd also switch to LWP::Simple, but that's
up to you.

- Chris.
-- 
$a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a
         "1 is equal to 2 for sufficiently large values of 1."

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to