Skip to content

Instantly share code, notes, and snippets.

@pjf
Created July 6, 2009 11:44
Show Gist options
  • Save pjf/141391 to your computer and use it in GitHub Desktop.
Save pjf/141391 to your computer and use it in GitHub Desktop.
=head2 autodie and string eval
Due to the current implementation of C<autodie>, unexpected results
may be seen when used near or with the string version of eval.
I<None of these bugs exist when using block eval>.
Under Perl 5.8 only, C<autodie> I<does not> propagate into string C<eval>
statements, although it can be explicitly enabled inside a string
C<eval>.
Under Perl 5.10 only, C<autodie> I<does not> operate correctly when
used inside a string C<eval>.
Under Perl 5.10 only, using a string eval when C<autodie> is in
effect can cause the autodie behaviour to leak into the surrounding
scope. This can be worked around by using a C<no autodie> at the
end of the scope to explicitly remove autodie's effects, or by
avoiding the use of string eval.
I<None of these bugs exist when using block eval>. The use of
C<autodie> with block eval is considered good practice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment