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

Re: handle autoviv bug + proposed fix

From:
Nick Ing-Simmons
Date:
February 26, 2000 14:53
Subject:
Re: handle autoviv bug + proposed fix
Message ID:
E12Oq5t-000767-00@mserv1b.u-net.net
Tom Christiansen <tchrist@perl.com> writes:
>Autovivified filehandles do not enjoy the same privileges as real
>handles do.  The problem is that they get autovivified to glob refs,
>not to globs.  

That was a "deliberate" mistake to make them mimic IO::* which
they are supposed to help make obsolete - I was not sure which to pick 
at the time. (I was sure that references to *glob{'IO'} was NOT what 
I wanted...)

>This is good for subsequent blessing, but it means
>there's a niggling inconsistency: the method call dispatch logic
>does not consider those two interchangeable, but should.  Watch.
>

>What should happen, though, is for to pretend that a ref(GLOB) is
>a GLOB, 

Or we could auto-vivify as globs.
But I quite like the idea of making this more consistent.

>just as we do in the rest of the places this occurs, such
>as all these valid cases:

>
>I imagine that to fix this problem, once you've determined that
>you've got a reference, you should do more than that first if{}
>(or, alternately, the last one) is doing right now.  I believe that
>you should check whether you've got a non-object reference that's
>actually referring to a GLOB, and if so, use some of the logic from
>the else{} case to fix this up accordingly.
>
>What do you think?

I think that is entirely reasonable approach on the surface at least.
Is this the "last" issue I wonder ...

-- 
Nick Ing-Simmons




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