From: Shawn M Moore Date: Sun, 26 Apr 2009 00:47:19 +0000 (-0400) Subject: Fix evaluation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1ad529292ab554660b848424b545db1e35e177cc;p=gitmo%2FPerl-Critic-Dynamic-Moose.git Fix evaluation --- diff --git a/lib/Perl/Critic/Policy/Dynamic/Moose.pm b/lib/Perl/Critic/Policy/Dynamic/Moose.pm index a6d84e1..8b71691 100644 --- a/lib/Perl/Critic/Policy/Dynamic/Moose.pm +++ b/lib/Perl/Critic/Policy/Dynamic/Moose.pm @@ -48,8 +48,11 @@ sub compile_document { my $self = shift; my $doc = $self->document; - eval "$doc"; - die "Unable to execute " . $doc->filename . ": $@"; + my $source_code = $doc->content; + + eval $source_code; + + die "Unable to execute " . $doc->filename . ": $@" if $@; } sub find_packages {