voyager has asked for the wisdom of the Perl Monks concerning the following question:
I can think of some brute force methods, but am looking for a more elegant solution that doesn't involve multiple trips thru the array, or saving "previous" values.
given above would return reference to second array element (don't want to be destructive to array), or perhaps set "isnext => 1" on the desired hash.$today = '2001-03-28'; $array = [{date => '2001-02-01', more } ,{date => '2001-03-31', " } # <- want this one marked "isnex +t" ,{date => '2001-04-15', " }];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Finding array element
by Masem (Monsignor) on Mar 28, 2001 at 22:57 UTC | |
by chromatic (Archbishop) on Mar 28, 2001 at 23:08 UTC | |
by Vondikall (Initiate) on Mar 29, 2001 at 17:04 UTC | |
by voyager (Friar) on Mar 28, 2001 at 23:05 UTC | |
|
Re: Finding array element
by sachmet (Scribe) on Mar 28, 2001 at 23:22 UTC |