in reply to Re^4: Improve foreach with help of map?
in thread Improve foreach with help of map?

For completness, the long version not using a regex. :-)
#!/usr/bin/perl use warnings; use strict; use HTML::TreeBuilder; my $html = do{local $/;<DATA>}; my $t = HTML::TreeBuilder->new_from_content($html); my $start; for my $td ($t->look_down(_tag => q{td})){ $start++, next if $td->as_text eq q{End Date}; next unless $start; next if $td->look_down(_tag => q{img}); print $td->as_text; last; } __DATA__ <td><b>End Date</b></td> <td><img src="http://welcome.hp-ww.com/img/s.gif" width="1" height="1" + border="0" alt=""></td> <td> 19 Jun 2012