http://www.perlmonks.org?node_id=1043814


in reply to Perl SNMP Error Handling

Of course. Simply test the defined nature of your object before trying to call the method.

if (defined $snmp) { ($descr,$uptime) = $snmp->get($vars); } else { die 'Horrors! My $snmp object is undefined!'; }

... or similar.

Replies are listed 'Best First'.
Re^2: Perl SNMP Error Handling
by Anonymous Monk on Jul 12, 2013 at 11:40 UTC
    Man... I feel like an idiot -_-