Skip to content

Instantly share code, notes, and snippets.

@nekoya
Created October 17, 2009 14:22
Show Gist options
  • Save nekoya/212352 to your computer and use it in GitHub Desktop.
Save nekoya/212352 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
package Person;
use Mouse;
sub chk {}
around chk => sub {
my $module = 'NoModule';
eval "use $module";
if ( $@ ) {
warn 'failed';
} else {
warn 'succeeded';
}
};
package main;
my $p = Person->new;
$p->chk;
warn 'exit';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment