in reply to use base 'XYZ' and exporting
package LikeOOModule; use base 'MyOOModule'; sub foo { my $self = shift; if ($self->mode == $self->OO_THIS) { ... } elsif ($self->mode == $self->OO_THAT) { ... } }
Solves the problem and allows for overloading, if necessary. Don't let the fact that it's currently a constant blind you to the fact that you may want to override it later. (Particularly in testing, I've found.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: use base 'XYZ' and exporting
by japhy (Canon) on May 29, 2005 at 16:57 UTC |