joec_ has asked for the wisdom of the Perl Monks concerning the following question:
@array = qw (1 1 0 2 0 1 3 0 0 4 1 1)
I would like to group the elements in 3s and print them to a file on one line, comma seperated i.e.
1,1,0
2,0,1
3,0,0
4,1,1
Any help appreciated.
Thanks
Joe
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Group array in threes
by moritz (Cardinal) on Feb 02, 2009 at 13:02 UTC | |
|
Re: Group array in threes
by toolic (Bishop) on Feb 02, 2009 at 13:48 UTC | |
|
Re: Group array in threes
by Bloodnok (Vicar) on Feb 02, 2009 at 13:50 UTC | |
|
Re: Group array in threes
by lakshmananindia (Chaplain) on Feb 02, 2009 at 13:21 UTC | |
|
Re: Group array in threes
by kyle (Abbot) on Feb 02, 2009 at 13:10 UTC | |
|
Re: Group array in threes
by johngg (Canon) on Feb 02, 2009 at 14:50 UTC | |
|
Re: Group array in threes
by fullermd (Vicar) on Feb 02, 2009 at 17:14 UTC | |
|
Re: Group array in threes
by JavaFan (Canon) on Feb 02, 2009 at 13:29 UTC | |
|
Re: Group array in threes
by hbm (Hermit) on Feb 02, 2009 at 13:43 UTC | |
|
Re: Group array in threes
by repellent (Priest) on Feb 02, 2009 at 17:18 UTC | |
|
Re: Group array in threes
by jethro (Monsignor) on Feb 02, 2009 at 13:05 UTC | |
by joec_ (Scribe) on Feb 02, 2009 at 13:24 UTC | |
by jethro (Monsignor) on Feb 02, 2009 at 13:46 UTC |