in reply to Determing the indice of an array
#!/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};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Determing the indice of an array
by rjray (Chaplain) on Mar 10, 2003 at 22:58 UTC |