From: Larry Wall Date: Mon, 22 Jun 1998 08:55:09 +0000 (-0700) Subject: deprecate use of reserved word "our" (Larry's idea) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=85b81015bdcfa6e7a9ccddddb0d3face7465f666;p=p5sagit%2Fp5-mst-13.2.git deprecate use of reserved word "our" (Larry's idea) Message-Id: <199806221555.IAA07212@wall.org> Subject: Re: our p4raw-id: //depot/perl@1276 --- diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 841be54..468e0a3 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -2747,6 +2747,15 @@ In code that currently says C you should remove AutoLoader from @ISA and change C to C. +=item Use of reserved word "%s" is deprecated + +(D) The indicated bareword is a reserved word. Future versions of perl +may use it as a keyword, so you're better off either explicitly quoting +the word in a manner appropriate for its context of use, or using a +different name altogether. The warning can be suppressed for subroutine +names by either adding a C<&> prefix, or using a package qualifier, +e.g. C<&our()>, or C. + =item Use of %s is deprecated (D) The construct indicated is no longer recommended for use, generally diff --git a/toke.c b/toke.c index c734fc8..5d0f8f3 100644 --- a/toke.c +++ b/toke.c @@ -4399,6 +4399,8 @@ keyword(register char *d, I32 len) case 3: if (strEQ(d,"ord")) return -KEY_ord; if (strEQ(d,"oct")) return -KEY_oct; + if (strEQ(d,"our")) { deprecate("reserved keyword \"our\""); + return 0;} break; case 4: if (strEQ(d,"open")) return -KEY_open;