in reply to chomp a List

Not so elegant way:
... my $coutnter; for( @dir ){ print $_; $counter++; print ',' unless $counter == @dir; } ...