#!/usr/local/bin/perl5.6.0 use strict; my $index_of_item; my $item = q{d}; for ( qw| a b c d e f g | ) { ( $_ eq $item ) ? last : $index_of_item++; } print qq{Index of [$item] is [$index_of_item]\n};
In reply to Re: Determing the indice of an array
by Wonko the sane
in thread Determing the indice of an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |