in reply to Re: question about what to grep(?)
in thread question about what to grep(?)
I've gone with hdb's suggestion in the other node with the nested foreach loops but I simplified the hash definition to
$haystack{"$a, $b, $c"} = \@zeros;I reversed the hash after reading that in perl, hashes are optimized for searching the keys, so now the \@zeros are the keys. But they're arrays, at least in my head. I'm used to thinking in terms of vectors, sets of ordered pairs, etc & not strings or whatever.
I'm interested in the keys that only contain integers so the "something" I was thinking of using a regex like this
/ (.*\.0000.*)|(.*\.9999.*) /because that would find floats with the right form. It's just I'm not sure what to put in the grep to make sure I'm getting only @zeros that have ALL integers inside & not just at least one. I wouldn't hve thought to use more than one grep like Don Coyote though. Maybe I need to learn more about grep... & then after finding a slice with the right keys, print out the corresponding values. But it's the grep part that I'm stuck on.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: question about what to grep(?)
by hdb (Monsignor) on Apr 12, 2013 at 15:52 UTC | |
by crunch_this! (Acolyte) on Apr 12, 2013 at 22:35 UTC | |
by hdb (Monsignor) on Apr 13, 2013 at 08:30 UTC |