in reply to Re: automatically giving user input to a command line
in thread automatically giving user input to a command line

I did try that, and unfortunately I am given the same problem as detailed in a previous comment, where it returns control to the user, and waits until the user does something, whether that be hitting 1 and then enter or something of the like. Thank you for the help though, I appreciate it.
  • Comment on Re^2: automatically giving user input to a command line

Replies are listed 'Best First'.
Re^3: automatically giving user input to a command line
by BrowserUk (Patriarch) on Jun 13, 2012 at 20:58 UTC
    it returns control to the user, and waits until the user does something, whether that be hitting 1 and then enter or something of the like.

    That suggests that the program is not accepting input via STDIN but rather via some form of direct access to the keyboard buffer, in which case, pretty much all of the mechanisms whereby you might try to control it from Perl will fail.

    What OS are you doing this on?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      Got a dumb question. If this happens to be on Windows, would it be possible to use system to call the program within the DOS start command (which would open a new DOS command prompt window to run the program and immediately return control back to the Perl script) and then try to use Win32::GuiTest to "interact" with that new command prompt window?

      I'm not saying this would be simple or easy or even elegant. Just trying to think of alternate methods of trying to interact with whatever program the OP is trying automate.

      If this happens to be a bad idea, I'd like to hear the reason(s) why so that I (and perhaps others) can learn something new.

        then try to use Win32::GuiTest to "interact" with that new command prompt window?

        Yes, Win32::GuiTest would be one way to tackle the problem.

        Another, potentially easier and yet more powerful way would be Win32::Console. It can do everything that Expect can do and more eg. mouse control.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        The start of some sanity?