Page 1 of 1

Module Perl

PostPosted: 14. February 2010 03:21
by hostsul
I would like to know how to install a perl module in xampp.

Module: Archive::Zip

OS: Windows Vista 64bit

Re: Module Perl

PostPosted: 14. February 2010 11:23
by Wiedmann
Which XAMPP?

Re: Module Perl

PostPosted: 14. February 2010 16:51
by hostsul
1.7.2, but now I saw that this module already exists, had not seen before. Sorry.

I do not understand because this module is returning error on xampp on my computer, and the same script runs without errors on the host.

Code: Select all
Can't call method "extractTree" on an undefined value at C:/xampp/htdocs/nabalada/2010/adminstracao/unzip.pl line 13. ,


Script:
Code: Select all
#!"C:\xampp\perl\bin\perl.exe"

use CGI;
print "Content-type: text/html\n\n";
$dados_form = $ENV{'QUERY_STRING'};
($nome, $value) = split(/=/, $dados_form);
($nome2, $value2) = split(/.zip/, $value);

use Archive::Zip;
$arquivo = "$value";
$saida = "./$nome2/";
my $zip = new Archive::Zip($arquivo); # Abre o arquivo
die "Erro ao Gravar" unless $zip->extractTree('', $saida, '') == AZ_OK;

Re: Module Perl

PostPosted: 14. February 2010 17:39
by Wiedmann
Code: Select all
my $zip = new Archive::Zip($arquivo); # Abre o arquivo
die "Erro ao Gravar" unless $zip->extractTree('', $saida, '') == AZ_OK;

Can't call method "extractTree" on an undefined value at C:/xampp/htdocs/nabalada/2010/adminstracao/unzip.pl line 13. ,

From the manual I would say, $zip is undefined, because the read from $arquivo fails for any reason. (btw, after reading the manual: isn't it "my $zip = Archive::Zip->new($arquivo);"? or better make the read in a separate step, to get the error message)