Using an external program like grep(1) from Perl is a waste, grep(1) does not do anything that perl can't doI agree with your assertion that, from a functional standpoint, Perl can do everything that Unix grep can do. I also agree that it makes sense to strive to avoid external programs whenever possible, one reason being the portability issue you mentioned.
However, it has been my experience that Unix grep is much faster than Perl under some circumstances; I have a small script which runs 50x faster if I replace the Perl file parsing code with Unix grep.
My point is that it may not always be a complete waste to use external tools.
In reply to Re^3: Access to directory -> Files -> contents & get the data (perl vs. grep)
by toolic
in thread Access to directory -> Files -> contents & get the data
by Sachin_dada
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |