Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Send a keyboard input to a process

by ISAI student (Scribe)
on Mar 07, 2011 at 09:45 UTC ( #891782=perlquestion: print w/ replies, xml ) Need Help??
ISAI student has asked for the wisdom of the Perl Monks concerning the following question:

Hello all. Say I have a process with a process ID (may be unrelated to the PERL script process), and I want to send it a keyboard message. Is that possible via PERL? I.E.
sendProcessMessage( 9010 "1 is one\n");
And process which id is 9010 will act as if it was just input "is is one" and a \n (if needed, one can add \r)? Thanks.

Comment on Send a keyboard input to a process
Download Code
Replies are listed 'Best First'.
Re: Send a keyboard input to a process
by Anonymous Monk on Mar 07, 2011 at 09:52 UTC
Re: Send a keyboard input to a process
by andal (Hermit) on Mar 08, 2011 at 07:41 UTC
    Depends on the process, not on perl. Some processes don't handle any keyboard input, so you can't send any input to that process. Those processes that handle input may do it using different ways, via controlling tty, or via events loop of GUI.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://891782]
Approved by Corion
Front-paged by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2015-11-29 19:27 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (752 votes), past polls