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

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

From:
Nicholas Clark
Date:
January 27, 2012 03:52
Subject:
Re: [perl #109146] 3-arg open of undef for read
Message ID:
20120127115233.GY18528@plum.flirble.org
On Fri, Jan 27, 2012 at 11:02:38AM +0000, Nicholas Clark wrote:
> On Thu, Jan 26, 2012 at 05:25:56PM -0800, Yitzchak Scott-Thoennes wrote:
> 
> > open(FH, "<", undef) triggers special behavior to open a temporary file
> > (at least with perlio) that is documented as only applying to +> and +<.
> > 
> > To keep open(FH, "<", $hash{typoedkey}) from quietly succeeding, this
> > should at least trigger a warning (and the doc be updated to not be mode
> > specific).
> 
> I think that a comprehensive fix should be possible. Note that XS can tell
> the difference:

Bother. I suspect I'm not correct here. XS can tell the difference because
there is a whole bunch of games when making the subroutine call. OPs don't
do this.

Nicholas Clark



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