It depends on the formatting of the error code.
Use dump_log or dump_input to get an idea of the output.
You could then use getline and test its content.
See Net::Telnet
Jim
Thank you Jim, I appreciate your. I'll follow the link and take your advice. Being that this the first time I'm writing a Perl script, I'd appreciate if anyone can direct me to tutorials or examples of this dumplog and getline.