This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
op.c:S_my_kid: Remove obsolete comment
authorFather Chrysostomos <sprout@cpan.org>
Sun, 29 May 2016 22:48:24 +0000 (15:48 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 29 May 2016 22:48:24 +0000 (15:48 -0700)
/* XXX does this let anything illegal in? */

The commit that added that comment indeed allowed ‘our $$x’ and even
‘my $$x’, so it was a problem at the time.  It was this commit:

commit 77ca0c92d2c0e47301d906d355d9ab3afb6f6bcb
Author: Larry Wall <larry@wall.org>
Date:   Fri Sep 24 14:59:37 1999 -0700

    Re: [PATCH 5.005_61] "our" declarations

This commit fixed the problem:

commit b6512f489e761186d508cf0b8b7705805cfefc52
Author: Mark-Jason Dominus <mjd@plover.com>
Date:   Mon Dec 24 13:14:48 2001 -0500

    PATCH: Restore "Can't declare scalar dereference in my" error

so the comment is no longer relevant.

op.c

diff --git a/op.c b/op.c
index 619c6e3..90258f2 100644 (file)
--- a/op.c
+++ b/op.c
@@ -3668,7 +3668,7 @@ S_my_kid(pTHX_ OP *o, OP *attrs, OP **imopsp)
        return o;
     } else if (type == OP_RV2SV ||     /* "our" declaration */
               type == OP_RV2AV ||
-              type == OP_RV2HV) { /* XXX does this let anything illegal in? */
+              type == OP_RV2HV) {
        if (cUNOPo->op_first->op_type != OP_GV) { /* MJD 20011224 */
            S_cant_declare(aTHX_ o);
        } else if (attrs) {