my $folder = path( $current, $to, $ts, $base_dir )->mkpath; #### my $folder_path = path( $current, $to, $ts, $base_dir ); $folder_path->mkpath; # This will print the path regardless if the path already existed or not print "My folder path is $folder_path\n"; #### my $mkpath_return_value = $folder_path->mkpath; # The value of $mkpath_return_value will be equal to the number of dirs 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 existed. #### my @dirs = $folder_path->mkpath;