in reply to Pop quiz: find the bug

The bug you are talking about would have been avoided using do blocks and not risking short-circuiting at the assignment expressions
SWITCH: { $id == $CASH && do{$tcash += $amt; last SWITCH}; ... }

Replies are listed 'Best First'.
Re: Re: Pop quiz: find the bug
by blakem (Monsignor) on Jul 03, 2002 at 23:33 UTC
    How about:
    SWITCH: { $id == $CASH and $tcash += $amt, last SWITCH; ... }

    -Blake