Just got my butt chomped by this one, so I thought I'd share.
What's wrong with this function?
The answer does not depend on the definition of bar. E.g. let bar besub foo { return eval { bar( shift ) } || 0; }
sub bar { return shift; }
The moral of the story: never use @_ inside an eval.print foo( 3 ), "\n"; $@ = 3; print foo( $@ ), "\n"; __END__ 3 0
the lowliest monk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Spot the bug!
by ikegami (Patriarch) on Oct 25, 2006 at 21:13 UTC | |
|
Re: Spot the bug!
by Errto (Vicar) on Oct 25, 2006 at 23:00 UTC | |
|
Re: Spot the bug!
by Anonymous Monk on Oct 26, 2006 at 07:13 UTC | |
|
Re: Spot the bug!
by tlm (Prior) on Oct 26, 2006 at 13:18 UTC | |
by diotalevi (Canon) on Oct 26, 2006 at 15:18 UTC | |
by tlm (Prior) on Oct 27, 2006 at 00:49 UTC | |
by diotalevi (Canon) on Oct 27, 2006 at 05:09 UTC |