in reply to Archive::Tar- how do I tar a whole directory tree

The last argument of create_archive is a list. You can generate a list of files that would be in a directory using glob. So you can call this as :
Archive::Tar->create_archive( "my.tar.gz", 9, glob "/this/*", glob "/t +hat/*" );

-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important

Replies are listed 'Best First'.
Re: Archive::Tar - how do you tar a directory tree?
by foogod (Friar) on Jan 08, 2002 at 20:20 UTC

    TIMTOWTDI

    A simple way is the command line code:

    #!/usr/bin/perl use strict; my $destination = "Archive_filename_to_be_created"; my $source = "/home/users/billyjo/stuff_to_backup/"; my $cmd = `tar -cpf $destination $source`; ####### The line above uses the backtick operation, not single quotes! + ##########

    As far as using the Archive::Tar module, (RTFM) :-)

    - f o o g o d