From: Junio C Hamano Date: Thu, 06 Jun 2013 21:58:41 GMT Subject: Re: [PATCH 17/18] Place the open() call inside the do{} struct and prevent failing close Message-ID: <7vbo7iyk8e.fsf@alter.siamese.dyndns.org> In-Reply-To: <51B0FF75.9070506@ensimag.fr> Célestin Matte 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(). So I am not sure your "we must check print" matches well with use of autodie, either. -- >8 -- #!/usr/bin/perl -w use warnings; use autodie; for (my $i = 0; $i < 256; $i++) { print "Did this die?\n"; } print STDERR "Hi\n"; for (my $i = 0; $i < 256; $i++) { syswrite(1, "Did this die?\n"); } print STDERR "Lo\n"; exit(0); --- 8< --