Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

(dkubb) Re: (2) Idiomatic Array Index Search?

by dkubb (Deacon)
on May 27, 2001 at 12:35 UTC ( #83581=note: print w/replies, xml ) Need Help??


in reply to Idiomatic Array Index Search?

I agree with japhy on this one, simple things should be kept simple. Here is a variation on his get_index routine that combines his routine with other idioms mentioned in this node:

my $index = get_index(\@array, $element); sub get_index { my ($a, $e) = @_; $e eq $a->[$_] and return $_ for 0..$#$a; return -1; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://83581]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2022-12-09 22:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?