sub foo { return eval { bar( shift ) } || 0; } #### sub bar { return shift; } #### print foo( 3 ), "\n"; $@ = 3; print foo( $@ ), "\n"; __END__ 3 0