Message-ID: <
20011224231448.25826.qmail@plover.com>
p4raw-id: //depot/perl@13881
} else if (type == OP_RV2SV || /* "our" declaration */
type == OP_RV2AV ||
type == OP_RV2HV) { /* XXX does this let anything illegal in? */
+ if (cUNOPo->op_first->op_type != OP_GV) { /* MJD 20011224 */
+ yyerror(form("Can't declare %s in my", OP_DESC(o)));
+ }
if (attrs) {
GV *gv = cGVOPx_gv(cUNOPo->op_first);
PL_in_my = FALSE;
#!./perl
-print "1..41\n";
+print "1..45\n";
eval 'print "ok 1\n";';
};
print "not ok 41\n" if $@;
}
+
+# Make sure that "my $$x" is forbidden
+# 20011224 MJD
+{
+ eval q{my $$x};
+ print $@ ? "ok 42\n" : "not ok 42\n";
+ eval q{my @$x};
+ print $@ ? "ok 43\n" : "not ok 43\n";
+ eval q{my %$x};
+ print $@ ? "ok 44\n" : "not ok 44\n";
+ eval q{my $$$x};
+ print $@ ? "ok 45\n" : "not ok 45\n";
+}