6 use autodie::exception;
9 autodie::hints->set_hints_for(
10 'Some::Module::some_sub' => {
11 scalar => sub { 1 }, # No calling in scalar/void context
12 list => sub { @_ == 2 and not defined $_[0] }
16 autodie::exception->register(
17 'Some::Module::some_sub' => sub {
20 if ($E->context eq "scalar") {
21 return "some_sub() can't be called in scalar context";
24 my $error = $E->return->[1];
26 return "some_sub() failed: $error";