Net:DNS:RR (sub-)classes and undefined methods

R

Rainer Weikusat

As I just discovered by accident (typo), when one tries to invoke an
undefined method using an object derived from Net::DNS::RR as invocant,
the code will log the following nuisance error

Oct 25 17:28:25 marsh mes-configurator[15868]: #011
Oct 25 17:28:25 marsh mes-configurator[15868]: ***
Oct 25 17:28:25 marsh mes-configurator[15868]: *** WARNING!!! The program has attempted to call the method
Oct 25 17:28:25 marsh mes-configurator[15868]: *** "" for the following RR object:
Oct 25 17:28:25 marsh mes-configurator[15868]: ***
Oct 25 17:28:25 marsh mes-configurator[15868]: *** <binary RR here>
Oct 25 17:28:25 marsh mes-configurator[15868]: ***
Oct 25 17:28:25 marsh mes-configurator[15868]: *** This object does not have a method "". THIS IS A BUG
Oct 25 17:28:25 marsh mes-configurator[15868]: *** IN THE CALLING SOFTWARE, which has incorrectly assumed that
Oct 25 17:28:25 marsh mes-configurator[15868]: *** the object would be of a particular type. The calling
Oct 25 17:28:25 marsh mes-configurator[15868]: *** software should check the type of each RR object before
Oct 25 17:28:25 marsh mes-configurator[15868]: *** calling any of its methods.

instead of causing the program to abort as it should. Consequently, it
will continue to work with incorrect data instead[*]. Using this code
seems very unwise to me because of that.

[*] To add insult to injury, what caused this brainfart to be printed
was an attempt to get the type of the RR where a $ happened to be in
front of the method name because of a typo, ie, $rr->$type() instead
of $rr->type().
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top