... since $foo is lexically re-declared in the assignment within the eval block (something that strictures would have warned you about).No, that's kosher with warnings and strictures:
>perl -wMstrict -le "sub S { return 'Something' } my $foo = 'bar'; eval { my $foo = S() }; die $@ if $@; print qq{after eval: $foo}; " after eval: bar
In reply to Re^2: eval and return values
by AnomalousMonk
in thread eval and return values
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |