in reply to pattern match -vs- *ix grep
Can anyone tell me of a better way to do this?Yes. Check your arguments. This little snippet could cause havoc if called with
Take a look at Two-arg open() considered dangerous for details.$ snippet.pl '| rm -rf *' 'ouch'
My point is that specialized utilities that have been around for a long time, like grep, have more than speed going for them. In general, they'll handle edge cases better.
If you want to demonstrate "the power of Perl", remember that power can be used for good or evil. :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: pattern match -vs- *ix grep
by Anonymous Monk on Apr 07, 2005 at 14:29 UTC | |
by VSarkiss (Monsignor) on Apr 07, 2005 at 17:05 UTC |