develooper Front page | perl.perl5.porters | Postings from December 2000

Re: [PATCH] Interesting syntax idea

Thread Previous
From:
perl5-porters
Date:
December 30, 2000 11:39
Subject:
Re: [PATCH] Interesting syntax idea
Message ID:
92ldn6$kov$1@post.home.lunix
In article <20001229151016.A8678@deep-dark-truthful-mirror.perlhacker.org>,
	Simon Cozens <simon@cozens.net> writes:
> On Fri, Dec 29, 2000 at 02:34:04PM +0000, Simon Cozens wrote:
>> +# Testing DWIM of foo = bar;
>> +sub foo : lvalue {
>> +    $a;
>> +}
>> +open bar, ">nothing" or die $!; 
> 
> This might cause people to wonder why I didn't test the case where
> you have a name representing both a filehandle and a subroutine.
> 
> The answer is, you can't (yet) do that. This is pretty weird:
> 
----snip----

Unless you can find a way to make both work, this is for me a sign
that you should choose one of the two. Otherwise you get interesting
action at a distance effects. e.g. first foo=bar works, then in 
some completely different part of the program a filehandle foo and bar
is set up (maybe even properly localised), and suddenly foo=bar stops
working or does something different. And that kind of action at a
distance is evil.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About