perl -le 'print join ",",map{chomp;$_}<>' file