diff options
author | Olivier Mengué <dolmen@cpan.org> | 2016-03-31 23:44:07 +0200 |
---|---|---|
committer | Olivier Mengué <dolmen@cpan.org> | 2016-04-01 00:05:35 +0200 |
commit | f8e3dd4db20c5ef34c6ca0064e74b42dca809eb2 (patch) | |
tree | 6c61b80bf45284717b73c01d78d7a0c95dd91f09 | |
parent | 94e23936f40b45d8e22189e34c1b7d34b0829194 (diff) | |
download | eval-closure-f8e3dd4db20c5ef34c6ca0064e74b42dca809eb2.tar.gz eval-closure-f8e3dd4db20c5ef34c6ca0064e74b42dca809eb2.zip |
Drop minor use of Try::Tiny
Try::Tiny was used just to conditionally use Perl::Tiny when
$ENV{EVAL_CLOSURE_PRINT_SOURCE} is set (which is mostly for debugging).
A plain eval-block is good enough for that case. This removes a
dependency and an import.
-rw-r--r-- | lib/Eval/Closure.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Eval/Closure.pm b/lib/Eval/Closure.pm index 1b90308..3021d68 100644 --- a/lib/Eval/Closure.pm +++ b/lib/Eval/Closure.pm @@ -9,7 +9,6 @@ use Exporter 'import'; use Carp; use overload (); use Scalar::Util qw(reftype); -use Try::Tiny; use constant HAS_LEXICAL_SUBS => $] >= 5.018; @@ -280,7 +279,8 @@ sub _dump_source { my ($source) = @_; my $output; - if (try { require Perl::Tidy }) { + local $@; + if (eval { require Perl::Tidy; 1 }) { Perl::Tidy::perltidy( source => \$source, destination => \$output, |