in reply to Use text string as stdin for system process
I suggest you try something like DBI to perform queries in perl. It's going to be a lot easier to maintain and operate.
But you can probably get this to work with pipes or something:
open my $out, "|sql>tmpfile" or die $!; print $out "select 'soemthing';\n"; print $out "exit;"; close $out; my $x = `cat tmpfile`;
To do the whole thing with pipes, look at IPC::Open3 or POE::Wheel or something.
-Paul
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Use text string as stdin for system process
by baldywilson (Initiate) on Jan 05, 2007 at 16:00 UTC | |
by derby (Abbot) on Jan 05, 2007 at 16:18 UTC | |
by baldywilson (Initiate) on Jan 05, 2007 at 16:33 UTC | |
by quester (Vicar) on Jan 05, 2007 at 23:14 UTC |