I've been searching around, but am not having any luck. I'm reading in a file into an array and looping line by line. It works great for the first ~4142 lines, then breaks. If i remove those first 4142 lines, rerun program, i can get through about 13k more lines then breaks again. Removing those lines from the file, the program immediately breaks at and error is thrown for the last line in file.
Any wisdom?
File Ex:
/imagedb/highres/01/1540901_4.jpg
/imagedb/highres/01/1540901_5.jpg
/imagedb/highres/01/1543001.jpg
/imagedb/highres/01/1540001.jpg
error: Use of uninitialized value in concatenation (.) or string at ./thumb_test2.pl line 54, <MYINPUTFILE> line 60608
... open(MYINPUTFILE, "<$load_file"); # open for input my(@lines) = <MYINPUTFILE>; # read file into list my($line); foreach $line (@lines) # loop thru list { chomp $line; @h = split(/\//, $line); #split the "/" to get hash value for dir my $hash = "$h[3]"; my $JPG = "$h[4]"; my $outfile = "/imagedb/thumb/$hash/$JPG"; #out put image my $out_path = "/imagedb/thumb/$hash"; my $image = Image::Resize->new($line); #make image my $gd = $image->resize(160, 120); open(FH, ">$outfile"); #print the image file print FH $gd->jpeg(); close(FH); #close image } close(MYINPUTFILE); ....

In reply to Reading 60k lines in file by b_gsmls

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.