Re: using IPC::Open3 to write to *and* read from a process...



Ben Morrow <ben@xxxxxxxxxxxx> wrote:
Quoth RU <ru@xxxxxxxxx>:

I'm currently working on some cluster scripts which, among other
things, need to start and stop oracle. The typical (/bin/sh) nasty
cluster script does something like:

#!/bin/sh
su -m oracle -c "sqlplus / as sysdba"<<_EOF_
startup
_EOF_

Firstly, I know very little about Oracle, but my impression is that
sqlplus just ends up sending SQL to the server? In which case, you can
likely do the whole thing from Perl with DBI, and not bother trying to
script an external binary at all.

When used in this way, sqlplus does something special, and is not simply a
client connection. It starts up a database that wasn't previously running.
I'm pretty sure that DBI would be unable to do this.

Having looked at the attempted Perl code (snipped) I'm now trying to figure
out why the above is nasty. It looks remarkably nice to me.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
.