Devel::EvalContext - Save lexicals and hints between calls to eval


Devel-EvalContext documentation  | view source Contained in the Devel-EvalContext distribution.

Index


NAME

Top

Devel::EvalContext - Save lexicals and hints between calls to eval

SYNOPSIS

Top

  use Devel::EvalContext;
  my $cxt = Devel::EvalContext->new;
  $cxt->run(q{ my $a = 5; });
  $cxt->run(q{ print $a; });

DESCRIPTION

Top

Sometimes it's necessary to run some code that creates lexicals and then run more code that uses the same ones. Perhaps it's in an interactive development environment.

However, unlike Scheme, perl's eval primitive doesn't take an extra parameter to specify the environment to evaluate inside of. This module corrects this deficit.

METHODS

Top

new

Create a new, empty context. It has no lexicals and hints are set to zero.

run

Equivalent to eval but with a context specified.

SUPPORT

Top

Please send bugs, queries or encouragement to <bug-Devel-EvalContext@rt.cpan.org> or <bsmith@cpan.org>.

SEE ALSO

Top

perlfunc

AUTHOR

Top

Benjamin Smith <bsmith@cpan.org>

COPYRIGHT AND LICENSE

Top


Devel-EvalContext documentation  | view source Contained in the Devel-EvalContext distribution.