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.
}
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");
require './test.pl';
}
-plan 28;
+plan 30;
my @warnings;
my $wa = []; my $ea = [];
object_ok $warnings[0], 'o',
'warn $tie_returning_object_that_stringifes_emptily';
+@warnings = ();
+eval "#line 42 Cholmondeley\n \$\@ = '3'; warn";
+eval "#line 42 Cholmondeley\n \$\@ = 3; warn";
+is @warnings, 2;
+is $warnings[1], $warnings[0], 'warn treats $@=3 and $@="3" the same way';
+
1;