Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Array searching, grep, first

by ChrisR (Hermit)
on Sep 01, 2005 at 17:46 UTC ( [id://488438]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!c:\perl\bin\perl.exe -w
    
    ...
        my ($test) = grep { $csvlist[$_] =~ /$x/} 0..$#csvlist;
        print "$x found at index: $test\n";
    }
    
  2. or download this
    file1 found at index: 2
    file2 found at index: 5
    file3 found at index: 0
    file4 found at index: 7
    file5 found at index: 4
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2024-04-18 11:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found