use strict; use warnings; my $text = do {local $/; <DATA>;}; $text =~ s/\n\n/\n/g; print $text; __DATA__ line 1 line 2 line 3
Prints:
line 1 line 2 line 3
which is what I would expect. What are you doing that is different?
In reply to Re: how to use matching operator on newlines
by GrandFather
in thread how to use matching operator on newlines
by redss
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |