Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Array searching, grep, first

by jimbus (Friar)
on Sep 01, 2005 at 18:13 UTC ( #488445=note: print w/ replies, xml ) Need Help??


in reply to Re: Array searching, grep, first
in thread Array searching, grep, first

There are usually 90-120 lines in the CSV per day, so I'm not sure it matters.

Can I get a little explaination on whats going on with grep { $csvlist[$_] =~ /$x/} 0..$#csvlist; it looks like it would be useful.

Jimbus

Never moon a werewolf!


Comment on Re^2: Array searching, grep, first
Download Code
Re^3: Array searching, grep, first
by friedo (Prior) on Sep 01, 2005 at 18:29 UTC
    What's going on here is that the list that is being greped consists of the numbers 0..$#csvlist. (Or zero through the highest index in the array.) The conditional inside the grep block looks at the array item indexed at each number and returns that number if the condition is true.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2014-08-20 05:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (105 votes), past polls