Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Problems? Is your data what you think it is?
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

I decided to learn Perl because I was unsatisfied by what I could achieve with batch and shell scripting. Granted, I knew only a little shell scripting, but I did a lot of batch scripting. In particular, flow control and error checking are difficult and verbose in a batch script. Also, there are too many things that you just can't do without firing up a C compiler and writing a utility or searching for a ported unix tool. The unix shells are better off, since one rarely needs to hack up a custom tool, but one needs to learn awk and sed and find and a thousand other little programs to do really cool stuff. Perl's portability is key.

The other thing that sold me on Perl over batch/shell scripting, is Perl's flexibility--once I built expertise in Perl, I knew I could apply it for many things other than the original problems I was trying to solve. Since you've already got a lot of Perl in your environment, using it in place of batch and shell will "deepen your bench"--more people will have and use skills that apply across your environment.

As to reasons to write something in a shell or batch file, I wouldn't go for a checklist. I'd say simply that "Everything should be written in Perl unless there is a compelling reason to do otherwise." Too often I've "known" that something need not be portable or will always be small, only to be proven wrong. Neither "it doesn't need to be portable", "it's really short" are reasons to write a batch or shell script instead of Perl. If either condition is false, there needs to be a very strong argument to go with a batch/shell solution over Perl.


TGI says moo


In reply to Re: Unix shell versus Perl by TGI
in thread Unix shell versus Perl by eyepopslikeamosquito

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (6)
    As of 2014-04-17 01:44 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      April first is:







      Results (437 votes), past polls