Capturing output with simultaneous File handle input

Discussion in 'Perl Misc' started by thomasjbs@gmail.com, Jul 2, 2005.

  1. Guest

    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.
    , Jul 2, 2005
    #1
    1. Advertising

  2. wrote:

    > Subject: Capturing output with simultaneous File handle input


    FAQ: How can I open a pipe both to and from a command?
    Brian McCauley, Jul 2, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dietrich
    Replies:
    1
    Views:
    627
    Joe Smith
    Jul 22, 2004
  2. Hoegje
    Replies:
    2
    Views:
    22,519
    Gianni Mariani
    Dec 5, 2003
  3. dmoore
    Replies:
    8
    Views:
    525
    Nick Craig-Wood
    Jun 10, 2007
  4. Replies:
    4
    Views:
    111
  5. rubyvic
    Replies:
    1
    Views:
    165
    Timothy Goddard
    Feb 12, 2006
Loading...

Share This Page