Return a reference to the correct lexical variable (not the copy)
Sartak [Mon, 26 May 2008 03:22:06 +0000 (03:22 +0000)]
git-svn-id: http://dev.catalyst.perl.org/repos/bast/trunk/Devel-REPL@4411 bd8105ee-0ff8-0310-8827-fb3f25b6796d

lib/Devel/REPL/Plugin/LexEnv.pm

index fd91a91..ea6d26b 100644 (file)
@@ -47,8 +47,10 @@ around 'execute' => sub {
 around 'find_variable' => sub {
   my $orig = shift;
   my ($self, $name) = @_;
-  my $variable = $self->lexical_environment->get_context('_')->{$name};
-  return \$variable if $variable;
+
+  return \( $self->lexical_environment->get_context('_')->{$name} )
+    if exists $self->lexical_environment->get_context('_')->{$name};
+
   return $orig->(@_);
 };