Dave's Brain

Browse - Programming Tips - How do I flatten an array?

Date: 2014nov11
Language: perl

Q.  How do I flatten an array?

A.  Use join() like this:

$flat = join(':', @a);
The first parameter to join is what you want between the array elements.

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.