=head1 TITLE Rename the C operator =head1 VERSION Maintainer: J. David Blackstone Date: 4 Aug 2000 Last Modified: 26 Sep 2000 Mailing List: perl6-language@perl.org Number: 19 Version: 2 Status: Frozen =head1 ABSTRACT The C operator of Perl5 and earlier does not do what it claims to and should be renamed. =head1 DESCRIPTION New Perl programmers are often confused by the behavior of the C operator, especially since a great deal of old educational material exists showing the obsolete practice of using C to create subroutine arguments and local variables. C does not provide variables that are local to the enclosing scope. Instead it permits what is known as dynamic assignment, the ability to temporarily assign a value to a variable such that the variable's original value will be restored when the current scope is exited. Relying on this mechanism to provide what most people think of as local variables (lexical scoping) can sometimes fail. C is useful in many cases and should be retained but renamed to reflect its action. Although the majority of the Perl community is agreed that this operator must be renamed, no consensus emerged as to what the new name should be. The author's favorites are C and C, although I find myself remembering a quote from a Tom Christiansen post about the subject where he went on to discuss the possiblity of "scopetemp"ing a lexical, so that seems catchy, too. =head1 IMPLEMENTATION Many replacement names have been proposed for local on the perl6-language list, and I am sure there are others that were proposed on p5p in earlier days. A list of other proposed replacement names includes (but is not limited to, since I certainly have forgotten some): C C C (to reflect the fact that the variable's old value is pushed onto a stack and popped off when the scope containing the use of the operator is exited) C C (not a good idea, in my opinion. I think that means making an exact copy of an object.) C C C C C C C C C C C C C C C C C (I'm not sure this was a proposal) None of these completely satisfies me, at the moment, and there does not appear to be any consensus among the group. =head1 REFERENCES The perlfunc manpage