Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Array indices

by Aristotle (Chancellor)
on Sep 14, 2002 at 06:00 UTC ( [id://197808]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub indices {
        my $match = shift;
    
        my $i = 0;
        map { $i++; $_ eq $match ? $i : () } @_
    }
    
  2. or download this
    sub indices {
        my $match = shift;
        grep $_[$_] eq $match, 0 .. $#_
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-03-19 05:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found