in reply to Creating a tarball

I doubt that the module Archive::Tar can help here. On the other hand, the utility ptar which comes with this module mimicks the tar command rather closely: it is using File::Find to collect files in a given directory. So I guess that your best choice would be to use File::Find instead of rolling your own recursive routine, copying whatever is useful from ptar.

Replies are listed 'Best First'.
Re^2: Creating a tarball [ptar and File::Find]
by kcott (Archbishop) on Feb 07, 2019 at 11:38 UTC

    G'day haj,

    Thanks for your feedback.

    I did come across ptar during my original research but didn't look at its source code: I wasn't aware of its use of File::Find. I'm extending legacy code which already uses Path::Tiny — discussed elsewhere in this thread — so, in the absence of other suggestions, that's probably the direction in which I'm heading. Anyway, thanks for your suggestion: I'll keep it in mind as a possible alternative option.

    — Ken

      Path::Tiny is fine! The ptar utility shouldn't use it because Path::Tiny is not in the "core" Perl distribution (yet), but since you already have it in your code, I'd prefer it, too.