$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;
}
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(@_);
}
sub _dump_source {
- my ($source, $name) = @_;
+ my ($source) = @_;
my $output;
if (try { require Perl::Tidy }) {
$output = $source;
}
- $name = defined($name) ? $name : "__ANON__";
- warn $name . ":\n" . $output . "\n";
+ warn "$output\n";
}
1;