add LexEnv plugin, rename $REPL to $_REPL to avoid clash with Lexical::Persistence
[p5sagit/Devel-REPL.git] / lib / Devel / REPL.pm
index 89c3a8b..b096f9b 100644 (file)
@@ -2,7 +2,7 @@ package Devel::REPL;
 
 use Term::ReadLine;
 use Moose;
-use namespace::clean;
+use namespace::clean -except => [ 'meta' ];
 
 with 'MooseX::Object::Pluggable';
 
@@ -51,9 +51,9 @@ sub eval {
 }
 
 sub compile {
-  my ($self, $line) = @_;
-  my $compiled = eval $self->wrap_as_sub($line);
-  return (undef, $self->error_return("Compile error", $@)) if $@;
+  my $_REPL = shift;
+  my $compiled = eval $_REPL->wrap_as_sub($_[0]);
+  return (undef, $_REPL->error_return("Compile error", $@)) if $@;
   return $compiled;
 }