in reply to split on newline
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: split on newline
by tbone654 (Beadle) on Sep 12, 2014 at 20:02 UTC | |
by ikegami (Patriarch) on Sep 13, 2014 at 00:29 UTC | |
by AnomalousMonk (Archbishop) on Sep 12, 2014 at 20:30 UTC |