in reply to Re^3: Not exactly Dereferencing... but in that ball park
in thread Not exactly Dereferencing... but in that ball park
Actually, based on the OP's code, where they're using "wc -l", they want a count. cat file | grep something | wc -l is the shell way to count the number of lines that match. Well, grep -c would probably be a bit more efficient. As would avoiding cat: grep -c something file. One process rather than three. Regardless, that's what the OP's code does.
As for the \Q, it's just a handy habit to be in. It's more likely to do what the programmer wants, which is why perl 6's default will be to match variables exactly, and require putting them in angle brackets to treat them as regexp strings to be parsed and matched.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Not exactly Dereferencing... but in that ball park
by gaal (Parson) on Nov 20, 2005 at 05:50 UTC |