ybiC has asked for the wisdom of the Perl Monks concerning the following question:
my $match = 0; my $pb = HTML::TokeParser->new(\$content); while($pb->get_tag('b', '/b') && $match < 1){ my $tb = $pb->get_text(); if($tb =~ /^\d+$/){ $num = $tb; ++$match; } }
ps - kudos to da loony sleepfree one for his HTML::TokeParser tutorial
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Exit while loop on first match
by Fletch (Bishop) on Apr 30, 2002 at 15:53 UTC | |
|
Re: Exit while loop on first match
by japhy (Canon) on Apr 30, 2002 at 16:09 UTC | |
|
Re: Exit while loop on first match
by erikharrison (Deacon) on Apr 30, 2002 at 17:00 UTC | |
|
Re: Exit while loop on first match
by jynx (Priest) on Apr 30, 2002 at 21:16 UTC |