Subject: | List form of backticks |
Date: | Wed, 29 Aug 2007 23:15:33 -0700 |
To: | via RT <bug-ExtUtils-MakeMaker [...] rt.cpan.org> |
From: | Michael G Schwern <schwern [...] pobox.com> |
Show quoted text
-------- Original Message --------
Subject: Re: [patch] First batch of whitespace patches (ExtUtils::MakeMaker)
Date: Sun, 26 Aug 2007 21:49:14 -0500
From: Ken Williams <ken@mathforum.org>
To: Michael G Schwern <schwern@pobox.com>
CC: Max Maischein <corion@corion.net>, Abhijit Menon-Sen <ams@toroid.org>,
perl5-porters@perl.org, makemaker@perl.org
References: <46C9E26B.3040203@corion.net> <20070821084415.GB19656@toroid.org>
<46CF31A2.2050104@corion.net> <46CF36C3.8010401@corion.net>
<46D0D599.7080507@pobox.com> <46D1D334.60307@corion.net>
<46D1E3B0.40601@pobox.com>
On Aug 26, 2007, at 3:33 PM, Michael G Schwern wrote:
> Max Maischein wrote:
Module::Build has this helper function:
sub _backticks {
my ($self, @cmd) = @_;
if ($self->have_forkpipe) {
local *FH;
my $pid = open *FH, "-|";
if ($pid) {
return wantarray ? <FH> : join '', <FH>;
} else {
die "Can't execute @cmd: $!\n" unless defined $pid;
exec { $cmd[0] } @cmd;
}
} else {
my $cmd = $self->_quote_args(@cmd);
return `$cmd`;
}
}
sub have_forkpipe { 1 }
-Ken
--
There will be snacks.
>>
>> How about using
>>
>> system(LIST)
>
> Alas, need to capture output.
>
>
>> or the list form of backticks instead of interpolating strings to
>> feed
>> to the shell.
>
> What list form of backticks?