in reply to excuting the tar command

Have you looked at the Archive::Tar module?

Cheers,
KM