No such thing as a small change | |
PerlMonks |
Re^2: I'm in trouble with Perl's OO programmingby chromatic (Archbishop) |
on Jun 09, 2005 at 17:32 UTC ( [id://465217]=note: print w/replies, xml ) | Need Help?? |
That will actually call the methods at the point of definition, not in the loop. I think you meant instead: $self->addTab( sub { $self->WatchLog() } );Another option is to provide the name of methods to call: $self->addTab( 'WatchLog' );and then call them with: $self->$code()That's really late binding and it can be useful.
In Section
Seekers of Perl Wisdom
|
|