in reply to regex : get a paragraph, not just line
Untested, but perhaps something such as:
LOOP: while (my $line = <DATA>) { my $line2 = undef; if ( $line =~ m/^\s+/ ) { while (my $line2 = <DATA>) { if ( $line2 =~ m/^\s+/ ) { $line .= $line2; } else { last; } } } # ... remaining processing here ... if (defined $line2) { $line = $line2; redo LOOP; } }
Hope that helps.
|
---|