in reply to shedding a bash wrapper and updating to Path::Tiny

I essentially want to combine what these 2 do

As for your code, it's pretty long and I've only skimmed it for now, but one thing I noticed is that you're using ->stringfiy a lot, into temporary variables. While certainly not wrong, it's kind of cluttering up your code a bit - for debug output, you should be able to print the objects directly, and also note that it's not necessary to stringify the objects only to turn them back into objects again later. Using $srd3 as an example:

my $rd3 = dir( ... ); my $srd3 = $rd3->stringify; mkdir $srd3 or warn "couldn't make $srd3: $!\n"; say "srd3 is $srd3"; $b = file( $srd3, $_ );

Can be written instead as:

my $rd3 = dir( ... ); $rd3->mkpath(); say "rd3 is $rd3"; my $f = $rd3->file( $_ );

Replies are listed 'Best First'.
Re^2: shedding a bash wrapper and updating to Path::Tiny
by Aldebaran (Chaplain) on Jul 11, 2018 at 17:37 UTC

    Thx haukex, I think I'm calling the mkdir method properly in this script so far. I'm getting alright partial results but want to cast the final solution in the idioms of Path::Tiny. Could I save myself the mkdir call by using the module better with the touchpath method?

    I don't seem to know how to refer to the "children" I've created other than by "$_". First, output: