Older versions of perl on Windows don't like the list form of pipe open,
and perlcritic doesn't like the string form of open, so we avoid both
with a simpler formulation using qx{}.
Per complaint from Amit Kapila.
local %ENV = $self->_get_env();
# We only want the version field
- open my $fh, "-|", $pg_config, "--version"
- or BAIL_OUT("$pg_config failed: $!");
- my $version_line = <$fh>;
- close $fh or die;
+ my $version_line = qx{$pg_config --version};
+ BAIL_OUT("$pg_config failed: $!") if $?;
$self->{_pg_version} = PostgresVersion->new($version_line);