From: Gurusamy Sarathy Date: Sun, 23 Jan 2000 10:04:03 +0000 (+0000) Subject: disallow our($foo::bar) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1ec3e8dea0b8d5fa438ad59d371998f774ea2f4d;p=p5sagit%2Fp5-mst-13.2.git disallow our($foo::bar) p4raw-id: //depot/perl@4857 --- diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 2ce165b..98ae3ad 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -1983,6 +1983,12 @@ where you wanted to redirect stdout. and found a 'E' or a 'EE' on the command line, but can't find the name of the file to which to write data destined for stdout. +=item No package name allowed for variable %s in "our" + +(F) Fully qualified variable names are not allowed in "our" declarations, +because that doesn't make much sense under existing semantics. Such +syntax is reserved for future extensions. + =item No Perl script found in input (F) You called C, but no line was found in the file beginning diff --git a/toke.c b/toke.c index e2e10f2..6f9f70c 100644 --- a/toke.c +++ b/toke.c @@ -1976,6 +1976,10 @@ Perl_yylex(pTHX) */ if (PL_in_my) { if (PL_in_my == KEY_our) { /* "our" is merely analogous to "my" */ + if (strchr(PL_tokenbuf,':')) + yyerror(Perl_form(aTHX_ "No package name allowed for " + "variable %s in \"our\"", + PL_tokenbuf)); tmp = pad_allocmy(PL_tokenbuf); } else {