(Output is : Goat index is 2.) It will be "undef" if "goat" is not found.my @a2=map { $array[$_][0] } 0..$#array; my ($goat_idx) = grep{ $a2[$_] eq "goat" } 0..$#a2; print "Goat index is $goat_idx.\n";
"If you had better tools, you could more effectively demonstrate your total incompetence."
In reply to Re: Index 2D Array
by NetWallah
in thread Index 2D Array
by RHC_ICT
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |