Solved

Press Enter to Continue...

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…

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