http://www.perlmonks.org?node_id=69188


in reply to Re: foreach interruption
in thread foreach interruption

Have you turned warnings on? I've seen behavior somewhat similar to that when a script attempts to reference an undefined variable, though the only variable defined outside of your snippet seems to be $ref->{prodname}. That seems like a fairly important variable, so I assume you've already checked it's value is correct. But in any case, since the bug is limited to that section, just remove all the lines them add them back individually until it breaks. Try just opening and closeing first, then add the file read, then the prints.

BTW, thread continuity is helped greatly by attaching replies to specific comments to that comment. Click on the reply's title to go to its node, then use the "Comment on..." link.