You can use the flexibility of a regexp to match the expected prompt without specifying the exact string. That way you can avoid the $device interpolation. It also would be better if you could anchor the prompt as the last thing read using '$'. You should turn off paging so you don't have to deal with a "more" paging prompt.
$telnet->prompt('/\w+# $/'); $telnet->waitfor($telnet->prompt); $telnet->cmd("terminal length 0"); @lines = $telnet->cmd("show run"); while (@lines) { print if /ip prefix-list/; }
In reply to Re: Problem with Net::Telnet
by jrogers
in thread Problem with Net::Telnet
by SDN
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |