The circular dependency between Carp and warnings was causing trouble
with new versions of Carp against very old versions of warnings (versions
that were bundled with Perl 5.6). No functional effect on blead.
dist/Carp/t/swash.t See if Carp avoids breaking swash loading
dist/Carp/t/vivify_gv.t See if Carp leaves utf8:: stuff alone
dist/Carp/t/vivify_stash.t See if Carp leaves utf8:: stash alone
+dist/Carp/t/with_warnings.t See if Carp plays nicely with warnings
dist/constant/lib/constant.pm For "use constant"
dist/constant/t/constant.t See if compile-time constants work
dist/constant/t/utf8.t Test Unicode constants under utf8 pragma
: @{"$class\::ISA"};
}
+if(!defined($warnings::VERSION) || $warnings::VERSION < 1.03) {
+ # Very old versions of warnings.pm import from Carp. This can go
+ # wrong due to the circular dependency. If Carp is invoked before
+ # warnings, then Carp starts by loading warnings, then warnings
+ # tries to import from Carp, and gets nothing because Carp is in
+ # the process of loading and hasn't defined its import method yet.
+ # So we work around that by manually exporting to warnings here.
+ no strict "refs";
+ *{"warnings::$_"} = \&$_ foreach @EXPORT;
+}
+
1;
__END__
--- /dev/null
+BEGIN { print "1..1\n"; }
+
+use Carp ();
+use warnings ();
+$SIG{__WARN__} = sub {};
+eval { warnings::warn("syntax", "foo") };
+print $@ eq "" ? "" : "not ", "ok 1\n";
+
+1;