use List::MoreUtils qw(firstidx); @input=('a','b','c','d'); my $char='b'; print firstidx { $_ eq $char } @input;
--
"Any sufficiently analyzed magic is indistinguishable from science" - Agatha Heterodyne
In reply to Re: Get Position of Element in an array
by mykl
in thread Get Position of Element in an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |