Quick Perl version with trailing slash handling:
ls -1 | perl -E 'say join ", ", map {chomp; $_} <>'
To explain:
- perl -E: execute Perl with features supports (say, ...)
- say: print with a carrier return
- join ", ", ARRAY_HERE: join an array with ", "
- map {chomp; $_} ROWS: remove from each line the carrier return and return the result
- <>: stdin, each line is a ROW, coupling with a map it will create an array of each ROW