in reply to search for blank lines by RegEx
If you are searching for blank lines in order to capture the data between them, then you might consider using paragraph mode. This should give you an idea of how to go about it:
{ local $/ = ''; while (<>) { print "Data block No. $.:"; foreach my $line (split /^/m) { line_func($line); } } }
See this perl.com article which discusses paragraph mode, $/, $. and other special variables.
Regards,
PN5
|
|---|