Permalink
Browse files

eval { use ...; } can't catch an exception

You must use 'eval "use ...;"' instead of.

    % perl -e 'eval "use Not::Installed;"'
    % perl -e 'eval { use Not::Installed; }'
    Can't locate Not/Installed.pm in @INC (...) at -e line 1.
    BEGIN failed--compilation aborted at -e line 1.
    %
  • Loading branch information...
kzys committed Mar 2, 2012
1 parent 05c16d5 commit f92c7359e7ae474186b544251982ce92115b3510
Showing with 1 addition and 1 deletion.
  1. +1 −1 xt/perlcritic.t
View
@@ -1,5 +1,5 @@
use strict;
use Test::More;
-eval { use Test::Perl::Critic -profile => 'xt/perlcriticrc' };
+eval "use Test::Perl::Critic -profile => 'xt/perlcriticrc'";
plan skip_all => "Test::Perl::Critic is not installed." if $@;
all_critic_ok('lib');

0 comments on commit f92c735

Please sign in to comment.