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
In reply to Exit while loop on first match by ybiC
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |