Solved

Press Enter to Continue...

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

705 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now