New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perl thinks a hash is a scalar in push/keys error messages #15774
Comments
From @xsawyerxCreated by @xsawyerxThis is a bug report for perl from xsawyerx@cpan.org, ----------------------------------------------------------------- When attempting to run "push" on a hash, we get the same error as when This was observed on both 5.22.1 and blead (past 5.25.8): 5.22.1: $ perl -v # OK # Should be "push on hash" 5.25.8 (blead): $ ./perl -v # OK # OK # Should be "push on hash" Perl Info
|
From @tonycozOn Sat, 17 Dec 2016 08:01:20 -0800, xsawyerx@gmail.com wrote:
Something like the attached? $ ./perl -e 'push %x,1;' -e 'pop %x;' -e 'push *x,1;' -e 'pop *x;' which matches what older perls did for the same code: *x;' without removing the useful message that the experimental feature has been removed. Tony |
From @tonycoz0001-perl-130367-separate-error-for-push-etc-on-hash-glob.patchFrom e6351e84883dbab5dad9844dbea7acc4f9b099cc Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Mon, 19 Dec 2016 10:49:27 +1100
Subject: (perl #130367) separate error for push etc on hash/glob
needs tests
---
op.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/op.c b/op.c
index 722ee35..b66181d 100644
--- a/op.c
+++ b/op.c
@@ -10044,6 +10044,10 @@ Perl_ck_fun(pTHX_ OP *o)
|| SvTYPE(SvRV(cSVOPx_sv(kid))) != SVt_PVAV )
)
bad_type_pv(numargs, "array", o, kid);
+ else if (kid->op_type == OP_RV2HV || kid->op_type == OP_PADHV
+ || kid->op_type == OP_RV2GV) {
+ bad_type_pv(1, "array", o, kid);
+ }
else if (kid->op_type != OP_RV2AV && kid->op_type != OP_PADAV) {
yyerror_pv(Perl_form(aTHX_ "Experimental %s on scalar is now forbidden",
PL_op_desc[type]), 0);
--
2.1.4
|
The RT System itself - Status changed from 'new' to 'open' |
From @xsawyerxOn Sun, 18 Dec 2016 16:02:50 -0800, tonyc wrote:
I only now saw I haven't responded to this. So sorry. Yes, this is perfect. |
From @tonycozOn Sun, 08 Apr 2018 00:38:54 -0700, xsawyerx@gmail.com wrote:
I missed your reply too. Applied as 5d4636a with some extra tests. Tony |
@tonycoz - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.30.0, this and 160 other issues have been Perl 5.30.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#130367 (status was 'resolved')
Searchable as RT130367$
The text was updated successfully, but these errors were encountered: