Hello. I am interested in writing a Perl script that can do the following:

1. read a list of user defined commands from a file
2. telnet (or possibly ssh) to a device such as a router, login, and interactively 
issue the commands read from the command list.
3. return the output from the commands to STDOUT or a file

Idealiy the next step would be to make this web-based where users could issue the 
commands via a cgi front end and return another page with the command output.

My questions are...

1. Can this be done entirely in Perl or does it require help from something like 
Expect for the interactive command part?

2. Can someone recommend modules, if available, that can be used for this?

3. I have written an expect script that does this, but would like to write it in perl- 
partly in the interest of learning perl. If it canot be done entirely in Perl, is 
there some way to embed the Expect functions within a Perl/cgi script?

Any advice would be greatly appreciated and thanks in advance.

Jose

Reply via email to