in reply to creating .tar.gz file

You can do what you want using Archive::Tar so long as IO::Zlib is also installed. The Archive::Tar documentation explains this.

You could also use 'tar' and 'gzip' commands from the command line - or from within system() commands within perl.

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: creating .tar.gz file
by narainhere (Monk) on Oct 31, 2007 at 12:23 UTC
    The second solution looks promising, some time back I was to do the same, here it goes
    $cmd="tar -cvf xyz.tar xyz.txt 2>&1"; system($cmd);
    This creates a archive named xyz.tar containing xyz.txt then
    $cmd="gzip xyz.tar 2>&1"; system($cmd);
    will create the xyz.tar.gz file for you!!

    The world is so big for any individual to conquer

      If your tar supports it, the you can make tar directly invoke gzip in one command, creating a .tar.gz file in one go, using the -z command line switch.
      ... or even (from memory, which at my time of life ain't what it used to be) ...

      `tar -cv xyz.txt | gzip -c > xyz.tgz`;
      At last, a user level that best describes my experience :-))