my $i = 0; foreach (@ARGV) { if ($i == 0) { print "$_"; $i = 1; } else { print ", $_"; } }