1Devel::REPL::Plugin::LeUxsEenrv(C3o)ntributed Perl DocumDeenvtealt:i:oRnEPL::Plugin::LexEnv(3)
2
3
4
6 Devel::REPL::Plugin::LexEnv - Provide a lexical environment for the
7 REPL
8
10 # in your re.pl file:
11 use Devel::REPL;
12 my $repl = Devel::REPL->new;
13 $repl->load_plugin('LexEnv');
14
15 $repl->lexical_environment->do(<<'CODEZ');
16 use FindBin;
17 use lib "$FindBin::Bin/../lib";
18 use MyApp::Schema;
19 my $s = MyApp::Schema->connect('dbi:Pg:dbname=foo','broseph','elided');
20 CODEZ
21
22 $repl->run;
23
24 # after you run re.pl:
25 $ warn $s->resultset('User')->first->first_name # <-- note that $s works
26
27
28
29perl v5.12.1 2010-05-23 Devel::REPL::Plugin::LexEnv(3)