in reply to perl 1-liner to join a list?

perl -0777 -le '$, = ","; print split /\n/, <>' file

Update: Added -0777 and split /\n/ per sauoq's comment

Replies are listed 'Best First'.
Re: Re: perl 1-liner to join a list?
by sauoq (Abbot) on Nov 11, 2003 at 21:44 UTC

    He doesn't want output like:

    foo ,bar ,baz

    That -l doesn't chomp unless it is used with -n or -p. I made the same mistake and quickly corrected it.

    -sauoq
    "My two cents aren't worth a dime.";