and form reading the docs, if methods are prototyped properly ($$), then they're invoked as object methods.Nope! Prototypes and method-calling are orthogonal. The caller can call any sub as a method, and if a sub is called as a method, the prototype is ignored. You should probably get rid of the prototypes unless you have another reason.
I recommend giving perlobj a good read to understand method calls a bit better. The following two calls are equivalent:
So when your handler sub is called as a method, and puts its first argument into $class, it contains the name of the class (a simple scalar). This makes things a little simpler for doing inheritance and subclassing. And that's why Data::Dumper is printing the name of the class -- perhaps you wanted to Dumper($r) instead? Or call handler as an object method ($obj->handler(...)) instead of a class method?My::Greeting->handler($r); ## class method My::Greeting::handler('My::Greeting', $r); ## equivalent
blokhead
In reply to Re: mod_perl and objects
by blokhead
in thread mod_perl and objects
by geektron
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |