rashley has asked for the wisdom of the Perl Monks concerning the following question:
One of the things that I need to do in that loop is set a flag that indicates whether or not there are any other elements in the array.foreach $_ (@list) { DO STUFF }
Something like:
So, what would go in the ??? ?if (???) { $data->{'IS_LAST'} = false; } else { $data->{'IS_LAST'} = true; }
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Check for next array element.
by Fletch (Bishop) on Nov 18, 2005 at 15:45 UTC | |
|
Re: Check for next array element.
by Aristotle (Chancellor) on Nov 18, 2005 at 15:45 UTC | |
|
Re: Check for next array element.
by friedo (Prior) on Nov 18, 2005 at 15:46 UTC | |
by rashley (Scribe) on Nov 18, 2005 at 15:52 UTC | |
by friedo (Prior) on Nov 18, 2005 at 16:26 UTC | |
by BaldPenguin (Friar) on Nov 18, 2005 at 18:47 UTC | |
by Aristotle (Chancellor) on Nov 18, 2005 at 19:18 UTC | |
by friedo (Prior) on Nov 18, 2005 at 18:50 UTC | |
|
Re: Check for next array element.
by Eimi Metamorphoumai (Deacon) on Nov 18, 2005 at 15:53 UTC |