On 13 Oct 00, at 11:45, John Porter wrote: > Elaine -HFB- Ashton wrote: > > John Porter [jdporter@min.net] quoth: > > *> > > *>fgrep -v -f have wanted > > > > comm -2 want have > > What I think is interesting is that this seems to show > that in many people's minds, the problem domain for which > perl is suited overlaps greatly with the problem domain > which the unix tools were created to address. I don't think this should be viewed as that much of a coincidence, should it? Way back when, I thought Larry started on Perl precisely to regularize and merge-into-one-app the chaos of the dozens of Unix apps that he was using for this and that around JPL. There are short Perl programs that can almost be char-for-char short AWK programs; it surely isn't an accident that Perl has an operator called "grep" [try explaining the sense of that to someone not familiar with Unix, especially the 'p' for 'print' part..:o)]. Instead of having to master 50 programs, each with a 4-page manpage, with Perl you get to only have to master one program, with a 200-page manpage..:o) > And perl isn't always the winner. :-/ Indeed, I'd be surprised if it were. The traditional Unix apps are, in general, pretty highly optimized for what they do, written in C, bummed to within an inch of their life, etc... and so when you run into something that _just_fits_ something that one of the traditional Unix apps does, it might well be/often be best just to use the unix app. An occasional "@answer = `usetherightunixapp`;" can often replace a pile of tricky Perl code [and even speed up your program]. > As a concrete example, perl's data structures are always > managed in memory; while things like sort and merge have > been written to utilize on-disk buffers when necessary. > (Hmm... smells like an RFC...) Looking over our code, I see that as a rule, I use `date +<flags>` in preference to the 'POSIX::strftime' stuff; I use 'sum', rather than writing a checksummer in C partly for cross-system compatibility and partly/mostly for speed;; is there a perl equivalent as smooth and clear as $firstline = `head -1 $filename`?, I see calls to snmpget and snmpwalk and I'm sure that that's not hard to do with the appropriate Perl modules 'use'd but it is sure easy just ``ing the Unix tool... Being _on_ a Unix platform (and having used Perl almost since it first emerged from jpl, way back in the pre-camel days), I've always viewed Perl and the standard apps as being in symbiosis, rather than competition. /Bernie\ -- Bernie Cosell Fantasy Farm Fibers mailto:bernie@fantasyfarm.com Pearisburg, VA --> Too many people, too few sheep <-- ==== Want to unsubscribe from Fun With Perl? Well, if you insist... ==== Send email to <fwp-request@technofile.org> with message _body_ ==== unsubscribe