Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Testing Kbd input

Posted on 1997-03-25
5
Medium Priority
?
282 Views
Last Modified: 2012-06-22
Is it possible in Perl to test for keyboard input while
processing (reading from) a file? I'd like to get a status
report by hitting a key during lengthy processing. I'm using
perl 5.0001 for WindowsNT and I believe 'fork' is not
implemented. Even if I could use fork, how can I get a
status report and hence some kind of value from a block of processing to follow, i.e. a variable not yet initialized?
0
Comment
Question by:caplain032497
[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
  • 3
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
wormzer earned 200 total points
ID: 1203617
This can be done with fork.  Add this before your code that "does a whole bunch of processing"

   if (fork) {
      while (<>) {
         print "GOT ENTER\n"
      }
   }

   <code that does a whole bunch of processing>

With this, you'll fork off another process that just sits waiting for a return and then prints out "GOT ENTER".  There's a whole bunch more stuff you can do from here...  stopping the forked proces...  things like that
   
0
 

Author Comment

by:caplain032497
ID: 1203618
Edited text of question
0
 

Author Comment

by:caplain032497
ID: 1203619
Edited text of question
0
 

Author Comment

by:caplain032497
ID: 1203620
I've appended the question.
0
 
LVL 1

Expert Comment

by:wormzer
ID: 1203621
You're right...  Just fail my answer cus that's all I can think of. Sorry.
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
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…
Six Sigma Control Plans

722 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