Here's an example of reading the data in paragraph mode (see $/ for an explanation) and then applying your regex:
use strict; use warnings; local $/ = ""; while (<DATA>){ chomp; s/\n/,/g; print "$_\n"; } __DATA__ 1111 2222 3333 4444 5555 6666
In reply to Re: how to convert new line to ","
by moritz
in thread how to convert new line to ","
by bh_perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |