Re: [PATCH] change Perl syntax to support Perl 5.6
- From
Jeff King <peff@peff.net>
- Date
- Aug 30, 2008, 18:13 UTC
- Message-ID
- <20080830181333.GA14893@coredump.intra.peff.net>
- In-Reply-To
- <7vwshygyy9.fsf@gitster.siamese.dyndns.org>
On Sat, Aug 30, 2008 at 11:06:06AM -0700, Junio C Hamano wrote:
Show 8 quoted lines
> > Won't this execute the command using the shell, which means that > > metacharacters need to be escaped? I didn't try, but I'm pretty sure > > this would break > > > > git add -i "file with space" > > I didn't try either but I think you are right. And I agree we should say > we rely on 5.6 or newer.
I did just try, and it is indeed broken.
> I thought gitweb folks are targetting 5.6.1 as the minimum for unicode > support (Lea and Jakub Cc'ed)?
Has it been tested? I don't have perl 5.6 handy, but:
$ man perl58delta | grep -A8 'list form of'
· If your platform supports fork(), you can use the list form of
"open" for pipes. For example:open KID_PS, "-|", "ps", "aux" or die $!;
forks the ps(1) command (without spawning a shell, as there are
more than three arguments to open()), and reads its standard output
via the "KID_PS" filehandle. See perlipc. $ grep -- '-|' gitweb/gitweb.perl | head
if (open my $fd, "-|", git_cmd(), "rev-parse", "--verify", "HEAD") {
open my $fd, "-|", git_cmd(), "cat-file", '-t', $hash or return;
open my $fh, "-|", git_cmd(), "config", '-z', '-l',
open my $fd, "-|", git_cmd(), "ls-tree", $base, "--", $path
open my $fd, "-|", git_cmd(), "ls-tree", '-r', '-t', '-z', $base
open($fd, "-|", git_cmd(), 'for-each-ref',
open my $fd, "-|", git_cmd(), "show-ref", "--dereference",
open my $fd, "-|", git_cmd(), "name-rev", "--tags", $hash
open my $fd, "-|", git_cmd(), "cat-file", "tag", $tag_id or return;
open my $fd, "-|", git_cmd(), "rev-list",So either I am misunderstanding something, or gitweb uses a construct that needs perl 5.8.
-Peff