in reply to trying to get a loop to redo
dws has put you on the right track, but I'm having a little trouble with this statement:
...read stdin (from a program that sends messages to the command line)...I'm not sure I understand what you mean by "messages to the command line". However, your code snippet leads me to believe you're trying to invoke a program called composer from within your Perl program, then have it reply semi-intelligently, similar to an expect script.
To do that requires more work than just reading STDIN and writing STDOUT. You might want to look up IPC::Open2, IPC::Open3, or, if you really, really want to roll your own, the pipe function. Look at the perlipc docs for more detail.
I don't want to elaborate any further since I'm not sure I'm answering the question you intended to ask...
|
|---|