perl and DOS I/O

Discussion in 'Perl' started by Hemant Kumar, Aug 23, 2004.

  1. Hemant Kumar

    Hemant Kumar Guest

    Hi,
    I need to run a n iterations of a dos program from perl. I am using
    System ("program args");

    There are two interactions with DOS that I need to take care of though

    1) The program spews output that goes to the DOS window. Is there a
    way to absorb it and process it from perl script?

    2) Once the program reaches a certain point in execution, it requires
    an input from the keyboard to move ahead. How can I issue this input
    from the perl script.

    Thank you for giving this a thought.
    Hemant
    Hemant Kumar, Aug 23, 2004
    #1
    1. Advertising

  2. Hemant Kumar

    Guest

    (Hemant Kumar) wrote in message news:<>...
    > Hi,
    > I need to run a n iterations of a dos program from perl. I am using
    > System ("program args");
    >
    > There are two interactions with DOS that I need to take care of though
    >
    > 1) The program spews output that goes to the DOS window. Is there a
    > was to absorb it and process it from perl script?


    This is a FAQ: "Why can't I get the output of a command with
    system()?"

    It is also answered in the documentation of system() function.

    > 2) Once the program reaches a certain point in execution, it requires
    > an input from the keyboard to move ahead. How can I issue this input
    > from the perl script.


    This is covered in other FAQs: "How can I write expect in Perl?" but I
    don't know how well it works on Rendmondware.

    However you may do better to figure out how to prevent it pausing like
    this - maybe there are some command line switches. Maybe it can be
    made to read from a file instead.

    This newgroup does not exist (see FAQ: "What are the Perl newsgroups
    on Usenet?"). Please do no start threads here.
    , Aug 23, 2004
    #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. Ben Fairbank
    Replies:
    2
    Views:
    5,401
  2. john san
    Replies:
    19
    Views:
    726
    Diez B. Roggisch
    Feb 18, 2005
  3. tomhr
    Replies:
    27
    Views:
    1,400
    Mike Wahler
    Jan 12, 2006
  4. Robert Wallace

    my own perl "dos->unix"/"unix->dos"

    Robert Wallace, Jan 21, 2004, in forum: Perl Misc
    Replies:
    7
    Views:
    264
    Michele Dondi
    Jan 22, 2004
  5. Hemant Kumar

    Perl and DOS I/O

    Hemant Kumar, Aug 25, 2004, in forum: Perl Misc
    Replies:
    5
    Views:
    96
    Hemant Kumar
    Aug 26, 2004
Loading...

Share This Page