in reply to Re: "Method is not in the class but it is there!"
in thread "Method is not in the class but it is there!"

>> "if &CC2::Schema::BirthdayCardList::add_to_birthday_cards exists, you get the behaviour you are seeing" Yes, that is obvious, but as I mentioned there is no such method or a single word 'add_to_birthday_cards' in the module, CC2::Schema::BirthdayCardList. Also, it is not in UNIVERSAL, please see this :
perl -I ~/cc-tmpl/lib/ -MUNIVERSAL -le 'print "Yes.....\n" if UNIVERSA +L->can("add_to_birthday_cards")'
doesn't print "Yes.....". Also,
grep 'add_to_birthday_cards' /usr/lib/perl5/5.8.8/UNIVERSAL.pm -rli
outputs nothing.

Replies are listed 'Best First'.
Re^3: "Method is not in the class but it is there!"
by moritz (Cardinal) on Sep 05, 2011 at 10:22 UTC
    Note that Perl supports creation of methods with dynamic names at run time and compile time, so a grep not showing a result suggest that this might be the case.
Re^3: "Method is not in the class but it is there!"
by JavaFan (Canon) on Sep 05, 2011 at 10:38 UTC
    If you can't find it at all, and if the method uses variables, pass in a tied variable that dumps a stack trace on a FETCH. That should give you some line numbers to work with (or an indication the method was evalled into existence).
Re^3: "Method is not in the class but it is there!"
by Anonymous Monk on Sep 05, 2011 at 09:25 UTC
    Um, UNIVERSAL.pm is a core module, nobody edits UNIVERSAL.pm, but modules/programs, might at runtime, despite it being a bad practice, add symbols to UNIVERSAL namespace