craigmarksmith has asked for the wisdom of the Perl Monks concerning the following question:
returns#!/usr/bin/perl -w use HTML::TokeParser::Simple; my $p = HTML::TokeParser::Simple->new("clean.htm"); my $token = $p->get_token; #$token = $p->get_token; #$token = $p->get_token; print "1 " . $token->as_is . "\n"; my $p_blah = $p; print "2 " . getNextToken($p_blah) . "\n"; $token = $p->get_token; print "3 " . $token->as_is . "\n"; sub getNextToken { if(my $token_blah = $_[0]->get_token){ return $token_blah->as_is; } else { return "end"; } }
when I expected1 <p class=label> 2 Business insurance 3 </p>
1 <p class=label> 2 Business insurance 3 Business insurance
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTML::TokeParser::Simple copying?
by fglock (Vicar) on Nov 23, 2004 at 11:19 UTC | |
by craigmarksmith (Novice) on Nov 23, 2004 at 11:25 UTC | |
|
Re: HTML::TokeParser::Simple copying?
by Xenograg (Scribe) on Nov 23, 2004 at 17:57 UTC |