in reply to Re^2: Reading 60k lines in file
in thread Reading 60k lines in file

The elements are confirmed to return properly

Not in your provided code.

it works for several thousand images

That translates to 'infrequent error', and to 'can process some files successfully'. As do the statements about another 15K ... .

It's always the same line, yes.

Same line in the code, or hopefully and VERY helpful in debugging: always the same $line in the INPUT!? (Update: is it always the same image file or not? See Ikegamis comment below as well! A warn "input: $line\n" is a bit verbose but will pinpoint the file in question)

Please check this and do add code to check the returns esp. from split and gd.


Update: So you say, it's not the same file triggering the error. Not so nice. Ok. Try Ikegami's code or update your own suitably. If things still fail, then change

my $gd = $image->resize(160, 120);
my $gd; eval{$gd=$image->resize(160, 120)}; do{warn "processing error for file: $line - skipping\n"; next} if $@ o +r not ref $gd;

Similar caution for the 2nd gd call. I'm assuming you've some error + sanity checking by now for the open, split and gd calls.

Replies are listed 'Best First'.
Re^4: Reading 60k lines in file
by b_gsmls (Initiate) on Oct 08, 2009 at 17:10 UTC
    NOT the same file. Same line. Thanks for all ur help so far.