use constant MIN_IPC_SYS_SIMPLE_VER => 0.12;
# All the Fatal/autodie modules share the same version number.
-our $VERSION = '1.997';
+our $VERSION = '1.999';
our $Debug ||= 0;
':1.995' => [qw(:default)],
':1.996' => [qw(:default)],
':1.997' => [qw(:default)],
+ ':1.998' => [qw(:default)],
+ ':1.999' => [qw(:default)],
);
$call = 'CORE::system';
$name = 'system';
+ $core = 1;
} elsif ($name eq 'exec') {
# Exec doesn't have a prototype. We don't care. This
sub$real_proto {
+ # If we're inside a string eval, we can end up with a
+ # whacky filename. The following code allows autodie
+ # to propagate correctly into string evals.
+
+ my \$caller_level = 0;
+
+ while ( (caller \$caller_level)[1] =~ m{^\\(eval \\d+\\)\$} ) {
+ \$caller_level++;
+ }
+
# If we're called from the correct file, then use the
# autodying code.
- goto &\$code if ((caller)[1] eq \$filename);
+ goto &\$code if ((caller \$caller_level)[1] eq \$filename);
# Oh bother, we've leaked into another file. Call the
# original code. Note that \$sref may actually be a
makes it a scalar context, except when the C<:void> tag is used.
This problem does not exist in L<autodie>.
+"Used only once" warnings can be generated when C<autodie> or C<Fatal>
+is used with package filehandles (eg, C<FILE>). It's strongly recommended
+you use scalar filehandles instead.
+
=head1 AUTHOR
Original module by Lionel Cons (CERN).