package warnings;
-our $VERSION = "1.41";
+our $VERSION = "1.42";
# Verify that we're called correctly so that warnings will work.
# Can't use Carp, since Carp uses us!
# If we have an explicit level, bypass Carp.
if ($has_level and @callers_bitmask) {
+ # logic copied from util.c:mess_sv
my $stuff = " at " . join " line ", (caller $i)[1,2];
- $stuff .= ", <" . *${^LAST_FH}{NAME} . "> line $." if $. && ${^LAST_FH};
+ $stuff .= sprintf ", <%s> %s %d",
+ *${^LAST_FH}{NAME},
+ ($/ eq "\n" ? "line" : "chunk"), $.
+ if $. && ${^LAST_FH};
die "$message$stuff.\n" if $results[0];
return warn "$message$stuff.\n";
}
1;
__END__
+
=head1 NAME
warnings - Perl pragma to control optional warnings