#!/usr/bin/perl use strict; use warnings; my @names = qw (a b d f g ); # This is filled dynamically print join(',',@names); #### ->perl a.pl a,b,d,f,g~ >