sweetblood has asked for the wisdom of the Perl Monks concerning the following question:
Regardless of how I mangle the cmd, I still cannot get the errmsg method to return any error. In my actual code I,m not really concerned that the command will fail as in my example but it's quite possible that a file could be missing.#!/usr/bin/perl -w use strict; use Net::Telnet; my $user = 'foo'; my $passwd = 'bar'; my $t= new Net::Telnet(Host => '****.****.com', Errmode => "return"); $t->login($user, $passwd); print $t->errmsg, " login\n"; my @p=$t->cmd("dwho") or warn "ugh\n"; print $t->errmsg, " who\n"; print "\@p contains:\n", join("\n", @p),"End\n"; __END__ login who @p contains: sh: dwho: not found. End
Any Ideas???
TIA
Sweetblood
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::Telnet error trapping
by pg (Canon) on Nov 12, 2004 at 21:10 UTC | |
by Anonymous Monk on Dec 23, 2007 at 08:33 UTC | |
|
Re: Net::Telnet error trapping
by nuttervm (Initiate) on Oct 26, 2011 at 17:34 UTC |