Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have what is probably a simple problem but can't seem to get my head around it.
My first array looks like this...
I want to create a new array for each element from @start and that has 3 random elements from @start appended to it. I want to end up with something like this...my @start = ('dog','cat','bird','mouse','rat','snake','horse','cow','p +ig','lizard','lamb','zebra','lion','elephant','monkey');
Any help or guidance is most appreciated!my @want = ('dog lizard bird lamb', 'cat pig lion monkey', 'bird elephant bird horse', 'mouse cow rat zebra', 'rat snake mouse cat', 'snake pig dog cow', 'horse cat mouse zebra', 'cow monkey cat pig', 'pig bird dog lamb', 'lizard mouse lion dog', 'lamb lion pig zebra', 'zebra monkey bird mouse', 'lion horse snake lizard', 'elephant pig mouse zebra', 'monkey rat bird cat');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array problem
by BrowserUk (Patriarch) on Sep 27, 2008 at 02:33 UTC | |
by ikegami (Patriarch) on Sep 27, 2008 at 08:06 UTC | |
by JavaFan (Canon) on Sep 27, 2008 at 09:54 UTC | |
by BrowserUk (Patriarch) on Sep 27, 2008 at 13:49 UTC | |
by JavaFan (Canon) on Sep 28, 2008 at 20:09 UTC | |
| |
by AnomalousMonk (Archbishop) on Sep 27, 2008 at 07:30 UTC | |
|
Re: Array problem
by Anonymous Monk on Sep 27, 2008 at 02:22 UTC | |
by Anonymous Monk on Sep 27, 2008 at 02:53 UTC | |
by Anonymous Monk on Sep 27, 2008 at 04:27 UTC | |
|
Re: Array problem
by llancet (Friar) on Sep 27, 2008 at 06:26 UTC | |
by Anonymous Monk on Sep 27, 2008 at 08:37 UTC | |
|
Re: Array problem
by jdporter (Paladin) on Sep 28, 2008 at 20:53 UTC | |
by ikegami (Patriarch) on Sep 29, 2008 at 00:40 UTC |