Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2014-11-27 20:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (187 votes), past polls