From: Sartak Date: Mon, 26 May 2008 03:22:06 +0000 (+0000) Subject: Return a reference to the correct lexical variable (not the copy) X-Git-Tag: v1.003015~98 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b314b3ec66e440dbe04fc108403a062ab22084e6;p=p5sagit%2FDevel-REPL.git Return a reference to the correct lexical variable (not the copy) git-svn-id: http://dev.catalyst.perl.org/repos/bast/trunk/Devel-REPL@4411 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- diff --git a/lib/Devel/REPL/Plugin/LexEnv.pm b/lib/Devel/REPL/Plugin/LexEnv.pm index fd91a91..ea6d26b 100644 --- a/lib/Devel/REPL/Plugin/LexEnv.pm +++ b/lib/Devel/REPL/Plugin/LexEnv.pm @@ -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->(@_); };