| 1 | package Class::Listener; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use 5.006; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | our $VERSION = '0.01.04'; | |||||||||
| 8 | |||||||||||
| 9 | 1 | our $DEBUG = 0; | |||||||||
| 10 | |||||||||||
| 11 | 1 | our $callback_fmt = "_on_%s"; | |||||||||
| 12 | |||||||||||
| 13 | 1 | ▶ | sub signal : method | ||||||||
|
Subroutine
signal: called CC=3 SCAR=14.2
Pod
documented
| |||||||||||
| 14 | { | ||||||||||
| 15 | 1 | my $this = shift; | |||||||||
| 16 | |||||||||||
| 17 | 1 | my $event = shift; | |||||||||
| 18 | |||||||||||
| 19 | 1 | my $method = sprintf $callback_fmt, $event; | |||||||||
| 20 | |||||||||||
| 21 | 1 | ▶ | return $this->$method( $event, @_ ) if $this->can( $method ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | |||||||||||
| 23 | 0 | ▶ | warn "D: $method - unimplemented event called\n" if $DEBUG; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | |||||||||||
| 25 | 0 | return undef; | |||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 1 | 1; | |||||||||
| 29 | __END__ | ||||||||||