in reply to Searching mixed array?
use strict and warningsuse warnings; use strict; use List::MoreUtils qw(firstidx); my @fsg = (1, 2, 4, 5, qw(A B C)); printf "item with index %i in list is B\n", firstidx { $_ eq 'B' } @fs +g; printf "item with index %i in list is 2\n", firstidx { $_ eq 2 } @fsg; __END__ item with index 5 in list is B item with index 1 in list is 2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Searching mixed array?
by edieguez (Initiate) on Apr 27, 2011 at 02:27 UTC | |
by kennethk (Abbot) on Apr 27, 2011 at 13:18 UTC |