Link to home
Start Free TrialLog in
Avatar of stakor
stakorFlag for United States of America

asked on

Press Enter to Continue...

I have a perl script that is automating a process for data retrieval. It is pretty straight forward, with one exception. You need to interact with another program (GUI) to complete the process. So, I need to have the program print out an instruction, and then wait until the enter key is pressed, and then proceed with the rest of the automation. I don't know how to do the pause, wait for the enter key to be pressed...

#!/usr/bin/perl

# Do something useful
print "You need to do that other thing, then press 'Enter'. \n";

<Magic_Happens>

# Do something else
Avatar of sjklein42
sjklein42
Flag of United States of America image

Ironically, you were really close!  Use <> to read from stdin.

print "You need to do that other thing, then press 'Enter'. \n";

<>;

prnt "Now it is done\n";

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of sjklein42
sjklein42
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of stakor

ASKER

I knew it was going to be simple, I just had no idea it was that simple. Thank you very much.