in reply to Pop quiz: find the bug
He assures me that this is a documented feature.Indeed it is, right at the top of perlref:
Note that taking a reference to an enumerated list is not the same as using square brackets--instead it's the same as creating a list of references!As a special case, \(@foo) returns a list of references to the contents of @foo, not a reference to @foo itself. Likewise for %foo.@list = (\$a, \@b, \%c); @list = \($a, @b, %c); # same thing!
Update
I realized I didn't answer the question....
I think:
B::Deparse to the rescue: your code compiles to:
So you're continuing to the next case if $amt and the value being increased are both zero. Though that shouldn't cause any harm....
Update 2
Ack, I think I got it! Thanks Aristotle!
$amt can be negative. It can still bring one of the others to zero, then get decremented from the following branch.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Pop quiz: find the bug
by Aristotle (Chancellor) on Jul 03, 2002 at 23:37 UTC |