sub test1 { eval {return 1}; return 0; } sub test2 { my $tmp; eval {$tmp = 1}; return $tmp; } print test1(), test2();