By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,835 Members | 2,305 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,835 IT Pros & Developers. It's quick & easy.

How to determine if a key is pressed when tell user to hit any key to continue?

P: 74
I'm trying to figure out how to read if a key was pressed by the user. For example, a line from a file is displayed and the user is prompted to hit any key to see the next line in the file. I've tried getc(STDIN) with no luck. Maybe I didn't do it right; I don't know. Any suggestions on how I can do this?
Jul 29 '09 #1
Share this Question
Share on Google+
6 Replies


Expert Mod 100+
P: 589

P: 74
@RonB
I tried using that, too, but now I realize you probably have to insert use CGI qw/:standard/; to make it work, correct?
Jul 29 '09 #3

P: 74
@JWest46088
I'm still getting an internal server error from ReadKey, and I did give the program permissions. Any idea why?
Jul 29 '09 #4

KevinADC
Expert 2.5K+
P: 4,059
Maybe you missed this or did not understand:

Term::ReadKey - A perl module for simple terminal control


Term::ReadKey is not for CGI scripts. CGI script don't operate like local programs, you can't use the "hit any key to continue" philosophy. You have to use the "click this button to continue" where when the button is clicked on it sends data back to the CGI script and does whatever it needs to do.
Jul 29 '09 #5

P: 74
Oh okay. That's probably why getc didn't work either, huh?
Jul 29 '09 #6

KevinADC
Expert 2.5K+
P: 4,059
@JWest46088
Thats right
Jul 29 '09 #7

Post your reply

Sign in to post your reply or Sign up for a free account.