Guest User

Untitled

a guest
Jan 17th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. package Foo;
  2.  
  3. use Mouse ();
  4. use Mouse::Exporter;
  5. use Try::Tiny;
  6.  
  7. my @export = qw[
  8. Mouse
  9. Try::Tiny
  10. ];
  11.  
  12. Mouse::Exporter->setup_import_methods( also => \@export );
  13.  
  14. 1;
  15.  
  16. package Bar;
  17.  
  18. use Foo;
  19. use Try::Tiny;
  20.  
  21. sub t {
  22. my ($self,$d) = @_;
  23.  
  24. my $v = try {
  25. die "testing" if $d;
  26. 'no';
  27. } catch {
  28. $_;
  29. };
  30.  
  31. return $v;
  32. }
  33.  
  34. 1;
  35.  
  36. perl -Mfeature=:5.12 -MBar -e say Bar->new->t;
  37. no
Add Comment
Please, Sign In to add comment