in reply to SQLPLUS connect database
At the simplest, you could do:
my $result = qx{$ENV{ORACLE_HOME}/bin/sqlplus -L -V scott/scott \@data +base 2>&1};
You can read the documentation for qx/.../ in perlop. Probably a better solution would be to use Capture::Tiny:
use Capture::Tiny qw(capture); my ($stdout, $stderr, $exit) = capture { system("$ENV{ORACLE_HOME}/bin/sqlplus", '-L', '-V', 'scott/scott', + '@database'); };
Your original code escaped the @, so I carried that through in my examples. I'm not certain if that's intentional or not.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: SQLPLUS connect database
by ytjPerl (Scribe) on Jul 24, 2019 at 14:16 UTC | |
by holli (Abbot) on Jul 24, 2019 at 15:25 UTC | |
by ytjPerl (Scribe) on Jul 24, 2019 at 17:03 UTC | |
by holli (Abbot) on Jul 24, 2019 at 17:06 UTC |