From f8e3dd4db20c5ef34c6ca0064e74b42dca809eb2 Mon Sep 17 00:00:00 2001 From: Olivier Mengué Date: Thu, 31 Mar 2016 23:44:07 +0200 Subject: 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. --- lib/Eval/Closure.pm | 4 ++-- 1 file 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, -- cgit v1.2.3-54-g00ecf