Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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.


Never moon a werewolf!

Comment on Re^2: Array searching, grep, first
Download Code
Replies are listed 'Best First'.
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?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2015-11-30 10:11 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (769 votes), past polls