..or any passers by who are hunting for a way to make a path of directories they would be better following blue_cowdawg's advice in Re: "mkdir -p" equivalent? and using mkpath in File::Path
I always wonder how useful statements like "it's better to use X instead of Y" are if they don't say why X is better.

I'll bite. I say using the systems 'mkdir' is better than 'mkpath' because the arguments of 'mkpath' are hard to remember (without looking in the docs, what's the second argument of mkpath? How do I tell mkpath which mode I need? How do I create multiple directories in one go?). On top of that, 'mkpath' has a different name than 'mkdir'.

Sure, if you work on a system that doesn't have 'mkdir', you're better off to use File::Path. But then, programming in such an environment is like writing a novel without using the letter 'e'.

If they have a reason they can't use File::Path (even though it's a core module these days) they would be better using the built-in mkdir than shelling out to a system one.
And then you present a 17 line piece of code, which has a OS dependency as well, doesn't have an option to set a mode, and is verbose without an option to turn it off.

I strongly prefer to shell out using one line, have the ability to set the mode, and which, by default, is silent.

Perl --((8:>*

In reply to Re^2: How to build system calls using '=>' by Perl Mouse
in thread How to build system calls using '=>' by loris

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.