Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: foreach interruption

by malaga (Pilgrim)
on Apr 03, 2001 at 07:00 UTC ( #69183=note: print w/replies, xml ) Need Help??


in reply to foreach interruption

what i mean by interrupt, is this: my foreach loop runs and prints out a list of products that match the keyword. it works great. there are about 20 items that match. then, when i add the section that opens the file to dump some text that correcsponds to each item, it works fine but it stops after only one item. it no longer gives me all 20. am i explaining it right?

Replies are listed 'Best First'.
Re: Re: foreach interruption
by athomason (Curate) on Apr 03, 2001 at 07:53 UTC
    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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://69183]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (1)
As of 2021-12-05 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (31 votes). Check out past polls.

    Notices?