Skip to content

Instantly share code, notes, and snippets.

@EvanCarroll
Created May 13, 2009 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EvanCarroll/111338 to your computer and use it in GitHub Desktop.
Save EvanCarroll/111338 to your computer and use it in GitHub Desktop.
foreach my $method ( $poe_kernel->meta->get_method_list ) {
next unless $method =~ /^[a-z]/; #skip constants
next if $method eq 'run' or $method eq 'meta' or $method eq 'singleton';
around ( $method => sub {
my ( $sub, $self, @args ) = @_;
if ( Scalar::Util::reftype( $self ) eq 'ARRAY' ) {
$self = __PACKAGE__->instance;
}
$sub->( $self, @args );
} );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment