From: Jesse Luehrs Date: Thu, 21 Oct 2010 04:07:22 +0000 (-0500) Subject: eh, name isn't that useful X-Git-Tag: 0.01~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=409b8f4169b1febda0f36fa7eb66abd79624ada7;p=gitmo%2FEval-Closure.git eh, name isn't that useful --- diff --git a/lib/Eval/Closure.pm b/lib/Eval/Closure.pm index 5094d0a..680399a 100644 --- a/lib/Eval/Closure.pm +++ b/lib/Eval/Closure.pm @@ -20,7 +20,7 @@ sub eval_closure { $args{source} = _line_directive($args{description}) . $args{source} if defined $args{description}; - my ($code, $e) = _clean_eval_closure(@args{qw(source environment name)}); + my ($code, $e) = _clean_eval_closure(@args{qw(source environment)}); croak("Failed to compile source: $e\n\nsource:\n$args{source}") unless $code; @@ -75,14 +75,14 @@ sub _line_directive { } sub _clean_eval_closure { - # my ($source, $__captures, $name) = @_ + # my ($source, $__captures) = @_ my $__captures = $_[1]; local $@; local $SIG{__DIE__}; if ($ENV{EVAL_CLOSURE_PRINT_SOURCE}) { - _dump_source(_make_source(@_), $_[2]); + _dump_source(_make_source(@_)); } my $code = eval _make_source(@_); @@ -109,7 +109,7 @@ sub _make_source { } sub _dump_source { - my ($source, $name) = @_; + my ($source) = @_; my $output; if (try { require Perl::Tidy }) { @@ -122,8 +122,7 @@ sub _dump_source { $output = $source; } - $name = defined($name) ? $name : "__ANON__"; - warn $name . ":\n" . $output . "\n"; + warn "$output\n"; } 1;