sub find_variable {
my ($self, $name) = @_;
+ # XXX: this code needs to live in LexEnv
+ if ($self->can('lexical_environment')) {
+ return \( $self->lexical_environment->get_context('_')->{$name} )
+ if exists $self->lexical_environment->get_context('_')->{$name};
+ }
+
my $sigil = $name =~ s/^([\$\@\%\&\*])// ? $1 : '';
my $default_package = $self->can('current_package')
return $self->$orig($wrapped, @rest);
};
-around 'find_variable' => sub {
- my $orig = shift;
- my ($self, $name) = @_;
-
- return \( $self->lexical_environment->get_context('_')->{$name} )
- if exists $self->lexical_environment->get_context('_')->{$name};
-
- return $orig->(@_);
-};
+# this doesn't work! yarg. we now just check $self->can('lexical_environment')
+# in FindVariable
+
+#around 'find_variable' => sub {
+# my $orig = shift;
+# my ($self, $name) = @_;
+#
+# return \( $self->lexical_environment->get_context('_')->{$name} )
+# if exists $self->lexical_environment->get_context('_')->{$name};
+#
+# return $orig->(@_);
+#};
1;