magnus has asked for the wisdom of the Perl Monks concerning the following question:
i'm not able to find this in my senility and i'm hoping it can be done:
I have a simple array of elements and i want to randomly chose an element out of that array, but when i do, i want it removed from the array. similar to pop or shift, but it doesn't necessarily take it from the ends...
thanks in advance for any help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: rand + shift || pop
by toolic (Bishop) on Dec 21, 2010 at 15:26 UTC | |
|
Re: rand + shift || pop
by Your Mother (Archbishop) on Dec 21, 2010 at 15:24 UTC | |
|
Re: rand + shift || pop
by kennethk (Abbot) on Dec 21, 2010 at 15:28 UTC | |
by magnus (Pilgrim) on Dec 21, 2010 at 15:32 UTC | |
by lidden (Curate) on Dec 21, 2010 at 15:58 UTC | |
by JavaFan (Canon) on Dec 21, 2010 at 16:41 UTC | |
by ikegami (Patriarch) on Dec 21, 2010 at 17:21 UTC | |
by davies (Monsignor) on Dec 22, 2010 at 15:54 UTC | |
|
Re: rand + shift || pop
by Anonymous Monk on Dec 21, 2010 at 15:22 UTC | |
|
Re: rand + shift || pop
by Anonymous Monk on Dec 21, 2010 at 15:24 UTC | |
|
Re: YAW: rand + shift || pop
by ww (Archbishop) on Dec 21, 2010 at 21:27 UTC |