develooper Front page | perl.perl5.porters | Postings from January 2012

Re: [perl #109146] 3-arg open of undef for read

From:
Aristotle Pagaltzis
Date:
January 27, 2012 21:51
Subject:
Re: [perl #109146] 3-arg open of undef for read
Message ID:
20120128055126.GM20306@fernweh.plasmasturm.org
* Zefram <zefram@fysh.org> [2012-01-27 12:35]:
> Nicholas Clark wrote:
> >I think that a comprehensive fix should be possible. Note that XS can
> >tell the difference:
>
> Better to distinguish at compile time.  Literal "undef" is a different
> opcode from "$undefined" or "$hash{typoed_key}".

Does that mean that a wrapper for `open` would have to do this in order
to provide an undef op?

    defined $name ? $name : undef

Ugh.

Or would even that not work because that’s an expression more complex
than a plain `undef`? Ugh.

Please, no.

-- 
*AUTOLOAD=*_;sub _{s/$/$"/;s/(.*):://;wantarray//substr$_,-1,1,",$/";print;$1}
&Just->another->Perl->hack;
#Aristotle Pagaltzis // <http://plasmasturm.org/>



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