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.