in reply to Re^4: Trying to capture an error using NET::TELNET
in thread Trying to capture error message using telnet::net

Most probably, you're just not declaring $telnet in a sufficiently large scope: the code you pasted above, as of itself is fine.

--
If you can't understand the incipit, then please check the IPB Campaign.