diff options
Diffstat (limited to 'lib/Reply/Plugin/Packages.pm')
-rw-r--r-- | lib/Reply/Plugin/Packages.pm | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/Reply/Plugin/Packages.pm b/lib/Reply/Plugin/Packages.pm index eb69f96..d6fad68 100644 --- a/lib/Reply/Plugin/Packages.pm +++ b/lib/Reply/Plugin/Packages.pm @@ -36,7 +36,6 @@ sub mangle_line { my $package = __PACKAGE__; return <<LINE; -package $self->{package}; $line ; BEGIN { @@ -47,16 +46,16 @@ LINE sub compile { my $self = shift; - my ($next, @args) = @_; + my ($next, $line, %args) = @_; + + $args{package} = $self->{package}; + + my @result = $next->($line, %args); # XXX it'd be nice to avoid using globals here, but we can't use # eval_closure's environment parameter since we need to access the # information in a BEGIN block - our $package = $self->{package}; - - my @result = $next->(@args); - - $self->{package} = $package; + $self->{package} = our $package; return @result; } |