is there an 'on key' command in perl?

F

firehand

I'm writing a program that takes many <stdin> after each other. All
the inputs are only one charters long (some are two but i can change
them if i habe to). That's why it would make my program work much
faster, if i didn't have to push 'enter' after every input and perl
would just do the next action after i pressed the letter or number. Is
this possible? I know it works in q-basic with a command called 'on
key' so I guess that's what I'm looking for for perl now.

please help me, thanks a lot,

firehand
 
A

Anno Siegel

firehand said:
I'm writing a program that takes many <stdin> after each other. All
the inputs are only one charters long (some are two but i can change
them if i habe to). That's why it would make my program work much
faster, if i didn't have to push 'enter' after every input and perl
would just do the next action after i pressed the letter or number. Is
this possible? I know it works in q-basic with a command called 'on
key' so I guess that's what I'm looking for for perl now.

Check out the module Term::ReadKey.

Anno
 
J

Jürgen Exner

firehand said:
I'm writing a program that takes many <stdin> after each other. All
the inputs are only one charters long (some are two but i can change
them if i habe to).

Please see 'perldoc -q character':
"How can I read a single character from a file? From the keyboard?"

jue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,139
Messages
2,570,805
Members
47,356
Latest member
Tommyhotly

Latest Threads

Top