Skip to content

Commit 4a9f7eb

Browse files
committed
Incorporate tux's feedback
1 parent 7642024 commit 4a9f7eb

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

Makefile.PL

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -958,17 +958,15 @@ sub find_oracle_home {
958958
s:/lib\w*/?$:: for @oh; # remove possible trailing lib dir
959959
}
960960
if ( !@oh && $^O eq 'linux' && -x '/sbin/ldconfig' ) {
961-
my $command = '/sbin/ldconfig -p';
962-
if ( open my $fh, q{-|}, $command ) {
963-
while (<$fh>) {
964-
if (m{^\tlibclntsh.$so[ ].*[ ]=>[ ](/.*)/libclntsh.so$}msx) {
965-
push @oh, $1;
966-
}
967-
}
968-
my $error = close $fh;
961+
my @cmd = qw( /sbin/ldconfig -p );
962+
if ( open my $fh, '-|', @cmd ) {
963+
local $/;
964+
push @oh => ( <$fh> =~
965+
m{^\tlibclntsh.$so[ ].*[ ]=>[ ](/.*)/libclntsh.so$}msg );
966+
close $fh or warn "Closing @cmd failed: $!\n";
969967
}
970968
else {
971-
warn "Cannot run: $command\n";
969+
warn "Cannot run: @cmd\n";
972970
}
973971
}
974972
if (!@oh) { # else try the traditional kind of install

0 commit comments

Comments
 (0)