in reply to Re (tilly) 2: How to call Class method inside an object?
in thread How to call Class method inside an object?
Now I'm open to the argument that having good access to data in $self is a big help, but method dispatch works either way. (I just re-read perltootc last night.)package MyClass; sub new { my $class = shift; bless(\$class, $class); } sub do_it { print "Doing something!\n"; } package main; my $c = MyClass->new(); my $class = 'MyClass'; $c->do_it(); $class->do_it();
|
---|
Replies are listed 'Best First'. | |
---|---|
Re (tilly) 4: How to call Class method inside an object?
by tilly (Archbishop) on Apr 28, 2001 at 20:42 UTC |