http://www.perlmonks.org?node_id=910666


in reply to array join missing zero and space

'join' glues stuff together, with the string you specified as the glue.

You only have four spaces between your five fingers. Notice you don't get a trailing zero either...

To do what you want using a similar approach:

my @numbers = (4,7,11,14);
my $start='0 ';

print $start, join (" $start" , @numbers),"\n"; # notice the added space in the join string, but not the prefix string

--Dave