Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Interacting With A Program Over Stdin/Execby arunhorne (Pilgrim) |
on Jun 23, 2004 at 09:58 UTC ( [id://368989]=perlquestion: print w/replies, xml ) | Need Help?? |
arunhorne has asked for the wisdom of the Perl Monks concerning the following question: Monks I am working on writing a Perl wrapper around the command line control utilities of a server. It is a log in "shell" essentially, so you start it with some basic information such as host and port and it provides you with a prompt, as so: > {0}: What I need to do now is send command in to this prompt sequentially, and potentially conditionally depending on logic in my wrapper. E.g. if I want to send the commands "start" and then "exit", thus if I typed it the prompt would look as follows: > {0}: start > {1}: exit Is there any way in Perl I can achieve this, i.e. mimick manual input on stdin. If there is a way that uses only very core perl modules/core functionality that would be preferable as we only have a relatively basic installation of Perl and I cannot install new modules, but any help would be greatly appreciated. Kind regards,
____________ Arun
Back to
Seekers of Perl Wisdom
|
|