Re: Archive::Zip Compaitibility Issues??
by svenXY (Deacon) on Dec 15, 2008 at 15:45 UTC
|
Hi,
what happens if you click Start->Run->type 'cmd'->type 'perl -MArchive::Zip -e1'? Meaning: is Archive::Zip properly installed?
Regards,
svenXY | [reply] |
|
Hey thanks for the promt reply, typing 'perl -MArchive::Zip -e1' in the command prompt does nothing
C:\>perl -MArchive::Zip -el
C:\>
No error, no anything. I'm using the GUI PPM to install packages, and it has installed correctly for every other module i've ever installed. | [reply] [d/l] |
|
So you have the module Archive:Zip... though perhaps your module is too old. You should try to load it with the tags to import. On the command line, try
perl -MArchive::Zip=:ERROR_CODES,:CONSTANTS -e1
or just one of them, if it fails with both.
If that doesn't work, try upgrading the module. You could ask for the current version first:
perl -MArchive::Zip -le "print $Archive::Zip::VERSION"
(Windows quotes)
and check on CPAN if that version supports these tags, to see if that would likely fix it. | [reply] [d/l] [select] |
|
| [reply] |
|
I looked up the module on CPAN, and according to the dependencies list it should install. Try downloading from CPAN. I do use Archive::Zip on my XP box running AS 5.10 and it works great. I grab all my modules from CPAN though.
The only other thing I can come up with is that you may have Cygwin in your path causing issues?
| [reply] |
Re: Archive::Zip Compaitibility Issues??
by Anonymous Monk on Dec 15, 2008 at 16:10 UTC
|
Maybe confict between exports, do you have strict/warnings turned on ? | [reply] |
|
Ok, I've tried all the suggestions up to this point. Upgraded where possible, tried to do a simple non gui script (has the same problem), and have turned trict and warnings on and off with no change. Perhaps it is time to set my desk on fire?
use Archive::Zip;
use strict;
use warnings;
my $zip=Archive::Zip->New();
my @filestozip=('RED_b0.apf','RED_b1.apf','RED_b2.apf','RED_b3.apf');
my $filelist=$zip->addFile(@filestozip);
$zip->writeToFileNamed('testthis.zip');
| [reply] [d/l] |
|
my $filelist=$zip->addFile(@filestozip);
Two things to note here: (1) addFile() does
not take a list of files, (2) it returns undef "if the name given does
not represent a readable plain file or symbolic link". I'm not
entirely sure whether that's the issue in your case, but at least,
it's worth checking the return value...
| [reply] [d/l] [select] |
|
|
I cut and pasted this and got the following error:
Can't locate object method "New" via package "Archive::Zip" at use_test.pl line 7.
| [reply] |
|
|
|
Re: Archive::Zip Compaitibility Issues??
by almut (Canon) on Dec 15, 2008 at 21:39 UTC
|
What output do you get if you enable debugging via the following
two environment variables?
(1) for DynaLoader (loading of XS modules, shared libs):
> set PERL_DL_DEBUG=1
> perl zipper.pl
(2) for execution tracing:
> set PERLDB_OPTS="AutoTrace NonStop"
> perl -ds zipper.pl
How far does the latter get? Does it terminate permaturely, i.e.
what are the last lines executed?
(See perldebug for other options you might want to set
with PERLDB_OPTS, e.g. frame=...)
| [reply] [d/l] [select] |
Re: Archive::Zip Compaitibility Issues??
by scorpio17 (Canon) on Dec 16, 2008 at 19:04 UTC
|
Archive::Zip depends on Compress::Zlib, which is itself a wrapper around the Zlib library. So, I'd suggest checking that you have the latest versions of both of those. | [reply] |
Re: Archive::Zip Compaitibility Issues??
by Rudif (Hermit) on Dec 17, 2008 at 22:12 UTC
|
Hello Commy_Code_Monkey
I have a command line script named ziprecent.pl, reproduced below. It uses Archive::Zip and a few other modules, all part of Active State Perl, or available via ppm.
It works nicely for me with 5.10 as it did for 5.8 and with earlier Perl builds.
Does it work for you ?
If yes, perhaps you will find out what you are doing differently, by comparing your script with mine.
If not, perhaps there is a problem with your perl installation.
HTH
Rudif
| [reply] [d/l] |