Solved

Press Enter to Continue...

Posted on 2011-02-18
3
615 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:stakor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Expert Comment

by:sjklein42
ID: 34931502
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

0
 
LVL 16

Accepted Solution

by:
sjklein42 earned 350 total points
ID: 34931504
A typo crept into my last post.  THis is better

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

<>;


print "Now it is done\n";

Open in new window

0
 

Author Closing Comment

by:stakor
ID: 34931536
I knew it was going to be simple, I just had no idea it was that simple. Thank you very much.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question