There isn't the s flag for the first regex. This will prevent the second from ever being run. For that matter, you can replace the entire while(){} with this regex:
$lines =~ s/\n+/\n/gs;
In reply to Re: remove blank lines with regex
by jeffenstein
in thread remove blank lines with regex
by amarceluk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |