This commit makes pp_warn stringify the warning if there is no
$SIG{__WARN__} handler. See the RT ticket for the discussion.
else {
exsv = newSVpvs_flags("Warning: something's wrong", SVs_TEMP);
}
- warn_sv(exsv);
+ if (SvROK(exsv) && !PL_warnhook)
+ Perl_warn(aTHX_ "%"SVf, SVfARG(exsv));
+ else warn_sv(exsv);
RETSETYES;
}
require './test.pl';
}
-plan 21;
+plan 22;
my @warnings;
my $wa = []; my $ea = [];
'Wide character in warn (not print)'
);
+fresh_perl_like(
+ 'warn []',
+ qr/^ARRAY\(0x[\da-f]+\) at /a,
+ { },
+ 'warn stringifies in the absence of $SIG{__WARN__}'
+);
+
1;