my ($idx) = grep $list[$_] eq '-p', 0..$#list; or die("-p not found\n"); ++$idx < @list or die("Missing value for -p\n"); my $val = $list[$idx];
In reply to Re: find element in array, then advance to next element
by ikegami
in thread find element in array, then advance to next element
by kathys39
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |