Subject: | Archive::Tar->write() of version 0.22 will NOT WORK on Win32 |
use Archive::Tar;
use strict;
my $tar = new Archive::Tar;
$tar->add_files($0);
for (0..1) {
eval { $tar->write('tmp' . scalar $_, $_) };
warn "case $_: $@" if $@;
}
__END__
case 0: Your vendor has not defined Fcntl macro F_GETFL, used at C:/Perl/site/lib/Archive/Tar.pm line 265.
case 1: Can't call method "gzwrite" on an undefined value at C:/Perl/site/lib/Archive/Tar.pm line 509.
in case 0, it's obvious what's at fault: you can't call fcntl on win32 apparently.
in case 1, this part is the problem:
$fh = Compress::Zlib::gzdopen_ ($fh, $mode, 0) or &_drat;
which occurs at roughly line 255 in my source (version 0.22)
since before that, Dumper $fh == $VAR1 = \*Symbol::GEN1;
and after that, Dumper $fh == $VAR1 = undef
this file also attached.
this bug has also been reported to activestate:
http://bugs.activestate.com/show_bug.cgi?id=22790
use Archive::Tar;
use strict;
my $tar = new Archive::Tar;
$tar->add_files($0);
for (0..1) {
eval { $tar->write('tmp' . scalar $_, $_) };
warn "case $_: $@" if $@;
}
__END__
Your vendor has not defined Fcntl macro F_GETFL, used at C:/Perl/site/lib/Archive/Tar.pm line 265.
Can't call method "gzwrite" on an undefined value at C:/Perl/site/lib/Archive/Tar.pm line 509.