in reply to Reading 60k lines in file

If you want to avoid the error you've quoted, you need to avoid using an uninitialized value in concatenation (.) or string at ./thumb_test2.pl line 54. Of course, I have no idea which line is 54, but I'll bet it's one of the many of the form my $hash = "$h[3]";. Assuming you are elevating warnings to errors, this will throw that error in cases where $h[3] is uninitialized, a.k.a. if line only had 3 elements for the example case. You could fix this by replacing that with

my $hash = defined $h[3] ? "$h[3]" : q{};

which will interpolate if the value is defined and will store an empty string (not an undef) in your variables.

Replies are listed 'Best First'.
Re^2: Reading 60k lines in file
by b_gsmls (Initiate) on Oct 08, 2009 at 16:04 UTC
    actually, the error points to the variable $line , the directory. going to try the while suggestion ...