in reply to joining lines efficiency?
Another option is the flip-flop operator: Read the file line-by-line, and don't print if between an opening expression and closing expression.
The general idea is print unless /<expr1>/ .. /<expr2>/, but here the slash and star need to be escaped.
while(<$fh>){ print unless m{/[*]} .. m{[*]/}; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: joining lines efficiency?
by hdb (Monsignor) on Jun 10, 2013 at 05:36 UTC | |
by AnomalousMonk (Archbishop) on Jun 10, 2013 at 16:16 UTC |