in reply to Re: Splitting a Sentence
in thread Splitting a Sentence
TIMTOWTDI - chomp in a map and join seems fairly concise yet readable.
$ perl -Mstrict -Mwarnings -E ' open my $inFH, q{<}, \ <<EOD or die $!; Line 1 Line 2 Line 3 EOD my $wholeText = join q{ }, map { chomp; $_ } <$inFH>; say $wholeText;' Line 1 Line 2 Line 3 $
I hope this is of interest.
Cheers,
JohnGG
|
|---|