public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Francis Galiegue <fge@one2team•com>
To: Jeff King <peff@peff•net>
Cc: Bill Pemberton <wfp5p@virginia•edu>,
	git@vger•kernel.org, gitster@pobox•com
Subject: Re: [PATCH 6/6] Remove bareword filehandles in git-send-email.perl
Date: Sun, 3 May 2009 23:34:03 +0200	[thread overview]
Message-ID: <200905032334.03286.fge@one2team.com> (raw)
In-Reply-To: <20090503205826.GF20468@coredump.intra.peff.net>

Le Sunday 03 May 2009 22:58:26 Jeff King, vous avez écrit :
> On Wed, Apr 29, 2009 at 09:12:23AM -0400, Bill Pemberton wrote:
> > The script was using bareword filehandles.  This is considered a bad
> > practice so they have been changed to indirect filehandles.
>
> I think this is a real improvement; using indirect filehandles mean they
> get scoped properly, which can avoid errors (especially forgetting to
> close() them, which happens automagically when they go out of scope).
> Assuming, of course, that the scoping added by your change is correct,
> and doesn't close a handle during a loop that we may have wanted to keep
> open (I didn't check carefully).
>
> But in the patch itself:
> > -	open(C,">",$compose_filename)
> > +	open my $C,'>',$compose_filename
>
> There are actually two things happening here:
>
>   1. s/C/my $C/, which I think is good
>
>   2. losing the parentheses around open(). This is a style issue, but I
>      think we usually prefer the parenthesized form of most perl
>      builtins (and certainly in the absence of other information, it
>      should be left as-is).
>

And why not go the full way and using IO::File?

my $fh = new IO::File;

$fh->open("/the/file", O_RDONLY|...)

-- 
Francis Galiegue
fge@one2team•com
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
One2team
40 avenue Raymond Poincaré
75116 Paris

  reply	other threads:[~2009-05-03 21:34 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-29 13:12 [PATCH 0/6] cleanups for git-send-email Bill Pemberton
2009-04-29 13:12 ` [PATCH 1/6] Remove return undef from validate_patch Bill Pemberton
2009-04-29 13:12   ` [PATCH 2/6] Remove function prototypes from git-send-email.perl Bill Pemberton
2009-04-29 13:12     ` [PATCH 3/6] Remove return undef from ask() Bill Pemberton
2009-04-29 13:12       ` [PATCH 4/6] Add explict return to end of subroutines Bill Pemberton
2009-04-29 13:12         ` [PATCH 5/6] Remove mix of high and low-precedence booleans Bill Pemberton
2009-04-29 13:12           ` [PATCH 6/6] Remove bareword filehandles in git-send-email.perl Bill Pemberton
2009-05-03 20:58             ` Jeff King
2009-05-03 21:34               ` Francis Galiegue [this message]
2009-05-04  6:12                 ` H.Merijn Brand
2009-05-04  6:53                   ` Francis Galiegue
2009-05-04  7:41                     ` H.Merijn Brand
2009-04-29 16:54           ` [PATCH 5/6] Re: Remove mix of high and low-precedence booleans Nicolas Sebrecht
2009-04-29 17:00             ` Bill Pemberton
2009-05-03 20:31         ` [PATCH 4/6] Add explict return to end of subroutines Jeff King
2009-05-03 20:26       ` [PATCH 3/6] Remove return undef from ask() Jeff King
2009-05-04  2:26         ` Jay Soffian
2009-05-03 20:27     ` [PATCH 2/6] Remove function prototypes from git-send-email.perl Jeff King
2009-05-03 19:46   ` [PATCH 1/6] Remove return undef from validate_patch Jeff King
2009-04-29 19:18 ` [PATCH 0/6] cleanups for git-send-email Junio C Hamano
2009-04-29 19:48   ` Bill Pemberton
2009-04-29 20:23     ` Junio C Hamano
2009-04-29 22:27     ` [PATCH 0/6] " Nicolas Sebrecht
2009-04-30  8:11       ` Andreas Ericsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200905032334.03286.fge@one2team.com \
    --to=fge@one2team$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=peff@peff$(echo .)net \
    --cc=wfp5p@virginia$(echo .)edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox