in reply to join using different delimiter for first element of list

If I'm understanding you correctly, you could do something like this:

use strict; use warnings; my @FieldNames = ( 'One' , 'Two' , 'Three' , 'Four' , 'Five' ) ; print join ':', shift(@FieldNames), join ',', @FieldNames;

or if you want a non-destructive technique, you could use array Slices:

print join ':', $FieldNames[0], join ',', @FieldNames[1..$#FieldNames];

Replies are listed 'Best First'.
Re^2: join using different delimiter for first element of list
by GrandFather (Saint) on Dec 08, 2010 at 01:49 UTC

    I'd go for slices just to avoid the vagaries of evaluation order! Side effects in evaluating parameter lists are a potent source of hard to track bugs.

    True laziness is hard work