disallow our($foo::bar)
authorGurusamy Sarathy <gsar@cpan.org>
Sun, 23 Jan 2000 10:04:03 +0000 (10:04 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Sun, 23 Jan 2000 10:04:03 +0000 (10:04 +0000)
p4raw-id: //depot/perl@4857

pod/perldiag.pod
toke.c

index 2ce165b..98ae3ad 100644 (file)
@@ -1983,6 +1983,12 @@ where you wanted to redirect stdout.
 and found a 'E<gt>' or a 'E<gt>E<gt>' 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<perl -x>, but no line was found in the file beginning
diff --git a/toke.c b/toke.c
index e2e10f2..6f9f70c 100644 (file)
--- 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 {