in reply to Sucking down a file
If you have no 'stop' phrase, you might use 'undef' on that side of the .. operator, or go with a more logical-looking flag approach:foreach (@lines) { next unless /start-phrase-here/ .. /stop-phrase-here/; # process }
U: I can't believe I didn't mention this originally, but you should probably be aware that parsing any HTML on your own is going to be extremely hard/unreliable, unless you have precise control over the formatting of the page. Better to use an HTML::Parser-derived module to pull the HTML data into Perl, and then work with the Perl data structure to get what you need.my $flag; foreach (@lines) { $flag++ if /start-phrase/; next unless $flag; # process }
|
|---|