When it's easier to write the shell script than the Perl version, for whatever value of "easier" passes your particular threshold. And it's going to be really, really subjective exactly what the threshold is from person to person and shell to shell.

Just as an example, where someone else might whip out File::Find (or File::Find::Rule) I might be just as likely to knock out a zsh one-liner right at my prompt since I've gotten fairly comfortable with it's pretty rich recursive globbing syntax. But then there's other stuff like moderately fancy CSV file manipulation that a better shell head might easily do with some arcane paste invocation that I'd break out Text::CSV_XS for.

If you're looking for generalities you'll likely get some pointers as to general areas of competency (like a shell's going to be better at chaining pipelines of commands together, where you'd be knee deep in system or open3 calls in Perl), but to know where it's going to be more appropriate for you you'll need to learn your tools and get comfortable enough that you know where your boundary lines are.


In reply to Re: Shell scripts and perl by Fletch
in thread Shell scripts and perl by sg

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.