in reply to Re: Ludicrously Stupid Foreach Loop Question
in thread Ludicrously Stupid Foreach Loop Question

G'day cLive,

The code that you've given above is slightly different from what I used in my example. I was keeping stock and shown seperated, whereas your code is adding them together. I was uncertain which the original poster required, so I erred on the side of caution and went with the most flexible result.

My original post mentions that checking for the existance of hash entries is intentional, in order to avoid warnings. However after checking with perl 5.6.1 and 5.005_03, += does not produce a warning if used with an undefined lvalue, so you're right, it is un-necessary even for avoiding warnings.

Thanks for the feedback, I'll update my original post accordingly.

Cheers,
Paul

  • Comment on Re: Re: Ludicrously Stupid Foreach Loop Question