in reply to idiom question

I see your question has been answered by Paladin. The alternative solution without worrying about side effects: if you want to increment counter as well as print, just replace and with a comma (,):
my $counter; foreach my $elem ( keys %users ) { $counter++, print "found $users{$elem}" if ($users{$elem}{sales} - + $users{$elem}{payments} > 0); }

Replies are listed 'Best First'.
Re: Re: idiom question
by geektron (Curate) on Jan 18, 2004 at 07:26 UTC
    to get past the issue i just ended up with the usual if () {} block. i needed to see the values only to verify information in the DB at the time. the 'balance due' didn't look like it was adding up, so i wanted to verify my accounting methods.

    and i'm also glad i'm not an accountant.