in reply to Extract individual lines and block of text from large files
You could add an inner loop:
Note that you need to escape the '/' in the DOCUMENT tag.{ $htm = join('',$1,$2,$3,$4); while ( my $htm_line = <$FH_IN> ) { last if $htm_line =~ m/^\s*<\/DOCUMENT>/i; $htm .= $htm_line; } }
In Section
Seekers of Perl Wisdom