On Sun, Jun 30, 2002 at 06:13:09PM +0200, Boris Bukowski wrote:
> sub _start {
> my $object=shift;
> my @args=@_;
> $object->{INTERVAL}=3;
> $object->SUPER::_start(@args);
> }
>
> the above Construct seems to be working for me and i use it very often.
> Is this ok or is there a better way ?
> I am a litle bit afraid with this Construct.
If $object->SUPER is never instantiated as an event handler, you could
give it a start() method that's not a POE event handler.
package Parent;
sub start {
my ($self, @stuff) = @_;
# ...
}
Child classes would define _start() to handle the event, but they
would not define start().
sub _start {
my $object = $_[OBJECT];
$object->{INTERVAL} = 3;
$self->start(@_[ARG0..$#_]);
}
I can't say whether your should do this or use your original
Construct. It depends on your program design and personal preference.
-- Rocco Caputo / [EMAIL PROTECTED] / poe.perl.org / poe.sf.net