in reply to Re: gzipping folder without tarring it first
in thread gzipping folder without tarring it first

Sure, .zip would be okay too.

I just tried a little, but I guess I got something wrong ...

$zip = Archive::Zip->new() foreach my $membername (map {glob} $dir) { if (-d $membername) { $zip->addTree( $membername, $membername ); } else { $zip->addFile ($membername); } } $zip->writeToFileNamed($archive);

It says that there's a syntax error near the foreach, but I don't get what it is :-(

Replies are listed 'Best First'.
Re^3: gzipping folder without tarring it first
by BrowserUk (Patriarch) on May 06, 2010 at 15:00 UTC

    Missing semicolon?

    $zip = Archive::Zip->new() ......................................^

      Ooops ... you're right, that was the error.

      Thanks !