There's more than one way to do things | |
PerlMonks |
Re: Determine first element in foreachby 1s44c (Scribe) |
on Aug 04, 2014 at 21:36 UTC ( [id://1096210]=note: print w/replies, xml ) | Need Help?? |
Can anyone tell me how i can obtain the first element? To answer the question exactly as asked you can shift off the first element:
That will remove the first element from the array leaving 'two','three'. If you don't want to alter the list you can directly access the first element:
In Section
Seekers of Perl Wisdom
|
|