Subject: Re: [PATCH 17/18] Place the open() call inside the do{} struct and prevent failing close

From: Célestin Matte <[email-masked]>
Date: Fri, 07 Jun 2013 00:16:55 +0200

Le 06/06/2013 23:58, Junio C Hamano a écrit :
> Célestin Matte <[email-masked]> writes:
> 
>> So using autodie may not be a good idea.
>> But the problem is that in the current state, open() return values are
>> checked, but print ones are not, although it should be.
> 
> I tried "man autodie" and tried to spot 'print' in the categories
> list that shows things like ":all covers :default which in turn
> covers :io which in turn covers read, seek, ..." and didn't see any.
> 
> Running the attached as
> 
> 	$ perl ad.perl >&-
> 
> gave me "Hi" (i.e. no failure from print) but of course killed a
> failing syswrite().

You're right, print is not in the list of function checked by autodie.

> So I am not sure your "we must check print" matches well with use of
> autodie, either.

So I'm not sure what we should do for print calls: should we
systematically check them all? That would be a painful and less-readable
thing to do. We may just not bother about it, after all...