Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit f92c7359e7ae474186b544251982ce92115b3510 1 parent 05c16d5
Kato Kazuyoshi kzys authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  xt/perlcritic.t
2  xt/perlcritic.t
... ... @@ -1,5 +1,5 @@
1 1 use strict;
2 2 use Test::More;
3   -eval { use Test::Perl::Critic -profile => 'xt/perlcriticrc' };
  3 +eval "use Test::Perl::Critic -profile => 'xt/perlcriticrc'";
4 4 plan skip_all => "Test::Perl::Critic is not installed." if $@;
5 5 all_critic_ok('lib');

0 comments on commit f92c735

Please sign in to comment.
Something went wrong with that request. Please try again.