Solved

Press Enter to Continue...

Posted on 2011-02-18
3
613 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
  • 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to delete rows in a file based on the file name. 5 60
Move Function in Perl Script 2 68
Extract data from span tag 1 92
Perl string filter 5 79
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…
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

786 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