![]() |
|
XP is just a number | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
I have a subroutine that a hash reference passed to it...
In my mains code, I test for an error and then stuff the value into $args{err} (This is being done through a Net::SNMP function)
Now, within the log_action subroutine, I pull in my hash reference
And I test to see if there is was an error message
Is this a suitable method? I read through defined and exists and it seems as though
may be more appropriate. How does perl judge if (args->{err}) when neither is used? And as a follow up question regarding whether defined or exists is the better to use... If there is no error returned via the Net::SNMP call, according to its documentation, it "returns an empty string". Please correct me if I am wrong, but this means that there will be a hash key present called $args{err} but there will be no value associated with it? Thanks -c In reply to Defined and Exists, but what about neither? by c
|
|