Capturing output with simultaneous File handle input

T

thomasjbs

I have a server process that allows queries and updates manually that I
want to automate.

I can actually connect to the service and make changes only if I pass
pre-known arguments that are then successfully changed on the server.
I do this with:

$object = $ARGV[0];
open(FILEIN,'| serverapp.exe');
print FILEIN "delete $object from dblist\n";

The problem is that I must manually specify what $object is before the
function works. There is another command (besides "delete") that tells
me a list of objects that I can obtain like this:

print FILEIN "list dblist name\n";

The above command will direct the server to print out all of the object
names in dblist - but I don't know how to capture the output in Perl.
I tried a number of pure guesses:

$r = print FILEIN "list dblist name\n";
and
$r = `print FILEIN "list dblist name\n"`;

I need to capture the output of a FILE HANDLE that lists output from
text commands printed to the FILE HANDLE.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top