in reply to tar options

To give your question at least a tiny perl slant:
use Sysadm::Install qw(untar_in); untar_in("tarball.tgz", "directory");