in reply to join using different delimiter for first element of list
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 |