It's possible I'm misunderstanding your question, but the cmd() function uses prompt to determine when a command has finished. It's important that the prompt is set correctly or else it will timeout. Prompts are usually set to tcsh, bash, sh, etc.. shell prompts. To read more about it, please view: Net::Telnet