1234567891011121314151617181920 #!/usr/bin/env perluse strict;use warnings;use Error::Pure;use Mo::utils qw(check_code);$Error::Pure::TYPE = 'Error';my $self = { 'key' => 'bad',};check_code($self, 'key');# Print out.print "ok\n";# Output like:# #Error [..utils.pm:?] Parameter 'key' must be a code.
#!/usr/bin/env perl
use
strict;
warnings;
Error::Pure;
Mo::utils
qw(check_code)
;
$Error::Pure::TYPE
=
'Error'
my
$self
= {
'key'
=>
'bad'
,
};
check_code(
);
# Print out.
print
"ok\n"
# Output like:
# #Error [..utils.pm:?] Parameter 'key' must be a code.