go ahead... be a heretic | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I think you are confusing yourself with arbitrary distinctions of exactly the kind that Perl cheerfully tramples over.
By your reasoning I would predict that local should not work on a hash value - because local replaces a scalar with another scalar temporarily. But lo and behold, look at this! What happened? Well take your pick. Either Perl doesn't agree with your distinction between "valid syntax to name an element of a collective" and "valid syntax for a scalar name" or else Perl is sometimes unusually willing to accept the former in places where one would expect the latter. (I lean towards the second interpretation - after all one cannot use my just anywhere, nor can one get that to make any sense.) Therefore if someone is willing to do the work and there is no ambiguity in the parsing, this feature could make it into Perl 5 and it wouldn't necessarily be a bad thing. Incidental note. One cannot use local on a lexical. This is an utterly arbitrary limitation - the feature was once put in only to be taken out because it was felt that where it happened it was undoubtably a mistake. In reply to Re: Re: Re: Re: Re: Re: Surpised by foreach iterator limitation
by Anonymous Monk
|
|