Your problem (interacting with some kind of remote shell prompt) seems to be almost exactly what Expect was designed to solve, and there is the Expect module on CPAN that provides that API in Perl.
In reply to Re: collect, set, and analyze command outputs
by jcb
in thread collect, set, and analyze command outputs
by dpasch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |