Hello Datz_cozee75,

I'm glad you found my post helpful. I don't see mkdir used anywhere in your code. When you refer to mkdir, I assume you are referring to the mkpath method from Path::Tiny that you use in a couple places (not to be confused with the perl function mkdir). So, code like this may need to be changed to do what you want...

my $folder = path( $current, $to, $ts, $base_dir )->mkpath;
The documentation for the Path::Tiny mkpath method states that it returns the list of directories created or an empty list if the directories already exist, just like make_path.. So perhaps this would be more useful,
my $folder_path = path( $current, $to, $ts, $base_dir ); $folder_path->mkpath; # This will print the path regardless if the path already existed or n +ot print "My folder path is $folder_path\n";
If you wanted to check the return value of the mkpath method, you could store it in a scalar like this,
my $mkpath_return_value = $folder_path->mkpath; # The value of $mkpath_return_value will be equal to the number of dir +s created (since the return value will be a list that is forced into # scalar context), or it will be equal to zero if the path already exi +sted.
or if you wanted the list of dirs that were created you could do this,
my @dirs = $folder_path->mkpath;


In reply to Re^6: shedding a bash wrapper and updating to Path::Tiny by kevbot
in thread shedding a bash wrapper and updating to Path::Tiny by Aldebaran

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.