summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-06-06 23:19:47 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-06-07 08:18:55 -0700
commitb1d0a83378b21d719f9e1fd57b852ca875a7c228 (patch)
tree05a5fbcb06aa56bd3f6618367888e04e95366825 /pp_sys.c
parent288163b0396d677d915ce0beb12619dc26646926 (diff)
downloadperl-b1d0a83378b21d719f9e1fd57b852ca875a7c228.tar.gz
Make warn treat $@=3 and $@="3" the same
If we get this: $ ./perl -Ilib -e '$@ = "3"; warn' 3 ...caught at -e line 1. then we shouldn’t get this: $ ./perl -Ilib -e '$@ = 3; warn' Warning: something's wrong at -e line 1. as the two scalars hold the same value.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 994bd6ce9c..79ef266c7f 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -453,7 +453,7 @@ PP(pp_warn)
}
else exsv = ERRSV;
}
- else if (SvPOKp(ERRSV) && SvCUR(ERRSV)) {
+ else if (SvPOKp(ERRSV) ? SvCUR(ERRSV) : SvNIOKp(ERRSV)) {
exsv = sv_newmortal();
sv_setsv_nomg(exsv, ERRSV);
sv_catpvs(exsv, "\t...caught");