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

Discussion in 'Perl Misc' started by Rainer Weikusat, Oct 25, 2012.

  1. 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().
    Rainer Weikusat, Oct 25, 2012
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben
    Replies:
    2
    Views:
    853
  2. Lawrence D'Oliveiro

    Death To Sub-Sub-Sub-Directories!

    Lawrence D'Oliveiro, May 5, 2011, in forum: Java
    Replies:
    92
    Views:
    1,934
    Lawrence D'Oliveiro
    May 20, 2011
  3. Sam Roberts
    Replies:
    0
    Views:
    189
    Sam Roberts
    Mar 20, 2005
  4. gavino
    Replies:
    2
    Views:
    146
    Ted Zlatanov
    Jul 27, 2006
  5. Morten Guldager

    classes and sub classes?

    Morten Guldager, Apr 9, 2013, in forum: Python
    Replies:
    7
    Views:
    124
    Neil Cerutti
    Apr 15, 2013
Loading...

Share This Page