You need two different things : first grab output from the external program, secondly feed it with your response. That's exactly what IPC::Open2 is for.
Search this site for examples using Open2, they abound.
If you want a more complex interaction, perhaps should you look at Expect instead... YMMV.
In reply to Re: Auto Feeding Data to Unix Programs
by wazoox
in thread Auto Feeding Data to Unix Programs
by awohld
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |