From: "H.Merijn Brand" <h.m.brand@xs4all.nl>
To: Francis Galiegue <fge@one2team.com>
Cc: Jeff King <peff@peff.net>, 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: Mon, 4 May 2009 09:41:08 +0200 [thread overview]
Message-ID: <20090504094108.0bf52762@pc09.procura.nl> (raw)
In-Reply-To: <200905040853.45186.fge@one2team.com>
On Mon, 4 May 2009 08:53:44 +0200, Francis Galiegue <fge@one2team.com>
wrote:
> Le lundi 04 mai 2009, vous avez écrit :
> [...]
> > >
> > > And why not go the full way and using IO::File?
> >
> > Because that would be travelling back in time.
> > The most efficient and preferred way is three-arg lexical:
> >
> > open my $fh, "<", $filename or die "$filename: $!";
> > while (<$fh>) {
> > # ...
> > }
> > close $fh or die "$filename: $!";
> >
>
> I don't see how using IO::File is going back in time at all. It's
> a standard perl module, even in 5.10.
It was written to be able to have lexical handles and pass them around.
With the above implementation you don't need to read a 600+ line module
to have every file action go through methods that are not needed at
all, and you also do not have to read the documentation for the
deviating syntax. I'd rather stick to simple, easy and standard.
> > > my $fh = new IO::File;
> > > $fh->open("/the/file", O_RDONLY|...)
> >
> > Why use a module for something that is neatly buit in?
>
> Because it reads better? YMMV, of course.
Because it is more efficient? And yes, it reads better, because it is
used in a zillion places already.
> I prefer using IO::File because perl has too many keywords for its
> own good :p
In the syntax I wrote down are now new keywords at all.
--
H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/
using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, OpenSuSE 10.3, 11.0, and 11.1, AIX 5.2 and 5.3.
http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/
http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
next prev parent reply other threads:[~2009-05-04 7:41 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
2009-05-04 6:12 ` H.Merijn Brand
2009-05-04 6:53 ` Francis Galiegue
2009-05-04 7:41 ` H.Merijn Brand [this message]
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=20090504094108.0bf52762@pc09.procura.nl \
--to=h.m.brand@xs4all.nl \
--cc=fge@one2team.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=wfp5p@virginia.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).