There's a difference between setting $/ to "\n\n" and and empty string. In this case, the empty string would probably be better. Also your regex line is far too complicated. I'd write this code as follows:
--$/ = ''; # set to grab whole paragraphs, not lines my @paras = <DATA>; my $whatever = qr/paragraph/; for (@paras) { print if /$whatever/m; } __DATA__ This is the first paragraph And paragraph two is here Here is the third paragraph to wrap it up
Perl Training in the UK <http://www.iterative-software.com>
In reply to Re: Re: Isn't there a print line function?
by davorg
in thread Isn't there a print line function?
by brassmon_k
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |