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. :-)
In reply to Re: pattern match -vs- *ix grep
by VSarkiss
in thread pattern match -vs- *ix grep
by ministry
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |