SamCG has asked for the wisdom of the Perl Monks concerning the following question:
I'm looking for a way to zip files with perl. I've checked out Tie::gzip, but the documentation isn't entirely clear to me (doing the stupidly obvious cut-and-paste from the POD, and then trying to write to a file, rewards me with a "cannot modify constant item in tie" error which leads me to believe I'm misunderstanding something completely).
I could give up and use a command-line utility from perl easily enough. Trouble is, I don't really want to rely on some 3rd-party utility. Also, I like learning things, and this seems like a good opportunity ;).
Okay, I'm going to post my first attempts at test code. Try not to laugh (well, you can if you want, just don't post laughter).
#!perl -w ## Windows XP box, perl 5.8.something use strict; require Tie::Gzip; open FIL, ">C:/test.zip"; tie FIL, 'Tie::Gzip'; print FIL "This is a zipped file";
Thanks,
SamCG
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Zip Enlightenment
by idsfa (Vicar) on Jan 21, 2005 at 21:44 UTC | |
Re: Zip Enlightenment
by graff (Chancellor) on Jan 22, 2005 at 08:28 UTC | |
by SamCG (Hermit) on Jan 24, 2005 at 15:08 UTC | |
by gmpassos (Priest) on Jan 24, 2005 at 23:06 UTC |