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

If you don't mind an extra comma at the end, try this: cat file | perl -e 'while (<>) {chomp;print $_,",";}; print "\n";'