You might want to look at this recent question: Challenge: Capturing stdout from a function call. which asks for something similar.

That said, File::Path is ancient code, and should be one the first modules to be taken out and shot when the revolution (Perl6) comes. Magic-number positional parameters are just so... twentieth century.

I don't mind modules I have to look up in order to remind myself how to use them, but when I have to look a module definition up in order to understand code already written there's something wrong.

Not to mention the fact that a library module that calls print is just wrong, wrong, wrong.

If File::Path were written today, it would use a hash, which would offer you named parameters and thus the code that uses it would be self-documenting. This would avoid the dilemma of what you are supposed to do when you want to set the third positional parameter when you don't care about the second. In this case you have to make a choice about what to set the second to, in order to get at the third.

File::Finder and File::Find::Rule are two other modules with nice interfaces that will let you do what you want.

- another intruder with the mooring of the heat of the Perl


In reply to Re: Custom File::Path messages by grinder
in thread Custom File::Path messages by Anonymous Monk

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.