The module you seek is Archive::Tar or specifically, Archive::Tar::Win32 if running on a Windows platform, which is transparently used in place of Archive::Tar on Windows platforms. The documentation for this module is very good and there is a sample implementation of tar written in perl using this module included in the module package.