Re: [patch] First batch of whitespace patches (ExtUtils::MakeMaker)

[email protected] (Michael G Schwern)
Newsgroups perl.perl5.porters,perl.makemaker
Message-ID <[email protected]>
Ken Williams wrote:
>> What list form of backticks?
> 
> 
> 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 }

That's very handy, I'll probably steal it.


-- 
Robrt:   People can't win
Schwern: No, but they can riot after the game.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.