- or download this
use Attribute::Handlers;
use Carp;
...
$referent->(@_)
}
}
- or download this
package EventHandlers;
...
my $name = *{$symbol}{NAME};
$EventHandlers{$name} = 1;
}
- or download this
package Annotations;
...
my ($this, $name) = @_;
$Annotations{$this}{$name}
}
- or download this
package Events;
...
my ($package, $symbol, $referent, $attr, $data, $phase) =
+@_;
Annotations::Annotate($referent, eventhandler => 1);
}
- or download this
if (my $event = MyEvents->can($CGI->param('event'))) {
die unless $event->annotation('eventhandler');
MyEvents->$event();
}
- or download this
$event->{eventhandler}
- or download this
annotation($event, 'eventhandler')