summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-03-05 18:11:52 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-03-05 18:38:47 -0800
commit3b7f69a598c44f5c3dc6fac662ca72212b7c22ec (patch)
tree3af81345e007f56d2f468b2436f6604508b2d9fc /pp_sys.c
parentfbc70a9e6c5a8b48dcdf2aa4f1f639d7064649cf (diff)
downloadperl-3b7f69a598c44f5c3dc6fac662ca72212b7c22ec.tar.gz
[perl #77384] Passing a ref to warn doesn't append file and line
This commit makes pp_warn stringify the warning if there is no $SIG{__WARN__} handler. See the RT ticket for the discussion.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 73a5c8ab55..30a2645459 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -449,7 +449,9 @@ PP(pp_warn)
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;
}