I have a command line script that tries to store a large file (~400mb) in
mogile, using MogileFS::ClientHTTPFile, but it's erroring out when I try to
close the file with the following error:
Can't call method "close" on an undefined value at (eval 11) line 1,
<F> line 1.
at (eval 11) line 1
IO::WrapTie::Master::close('IO::WrapTie::Master=GLOB(0x85dc4d4)')
called at storeInMogile.pl line 69
Can't call method "close" on an undefined value at (eval 11) line 1,
<F> line 1.
I've checked and my IO::WrapTie.pm is the lastest version (2.110), so I'm at a
bit of a loss. It seems to be the "tied(*$s)" call in the close method created
by PRELOAD that is causing the error. Anyone know how I can fix this?
Here's the relevant part of my script (which I'm sure will look very familar):
my ($file,$key,$size,$args) = ($ARGV[0],$ARGV[1], -s $file, { largefile => 1 });
open(F,"< $file") || die "Can't open file[$file]";
my $fh = $mogfs->new_file($key, "bigFile",$size,$args);
die "Unable to allocate filehandle.\n" unless $fh;
while (my $x = <F>) {
$fh->print($x);
}
die "Unable to save file to MogileFS.\n" unless $fh->close;
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.