Hello,
I'm encountering a problem with File::Util that I'm not able to see,
and I'm sure it's trivial:

my $handle_file = new File::Util;
my $files_for   = {};
my $max_file_size = int( 1024 * 1024 * 1024 );
$handle_file->readlimit( $max_file_size );

that once run produces the following trace:

PROCESS TERMINATED DUE TO ERRORS

Bad call to File::Util::readlimit().  This method can only be called with
a numeric value (bytes).  Non-integer numbers will be converted to integer
format if specified (numbers like 5.2), but don't do that, it's inefficient.

This operation aborted.

Origin:     This is a human error.
Solution:   A human must fix the programming flaw.

ARG   _pak = File::Util
ARG   bad = 1073741824

1. File::Util::_throw
    -called at line (1518) of /usr/local/share/perl/5.14.2/File/Util.pm
       -was called with args
       -was not called to evaluate anything


2. File::Util::readlimit
    -called at line (16) of test.pl
       -was called with args
       -was not called to evaluate anything



The documentation for File::Util::readlimit states that:

readlimit   => positive integer
                   Optionally specify this option to the
File::Util::new method to instruct
                   the new object that it should never attempt to open
and read in a file
                   greater than the number of bytes you specify.
Obviously this argument can
                   only be a numeric integer value, otherwise it will
be silently ignored.
                   The default readlimit for File::Util objects is
52428800 bytes (50
                   megabytes).

Any idea about what I'm missing?

Thanks,
Luca

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to