Hi Perl monks,
I'm trying to find the first element in a list using a foreach in order to do a different treatment:
foreach $element (@{my_list})what i want is something like:
foreach $element (@{my_list}) if ($element.fist) treat_1(); else treat_others();
Can anyone tell me how i can obtain the first element?
thanks
In reply to Determine first element in foreach by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |