my @words = <>; chomp(@words); print(join(';', @words), "\n");
As a one-liner:
perl -nle'push @w, $_; END { print join ";", @w }'
-l inserts a chomp; into -n's (and -p's) loop.
In reply to Re: split on newline
by ikegami
in thread split on newline
by tbone654
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |