Skip Menu |
 

This queue is for tickets about the Devel-REPL CPAN distribution.

Report information
The Basics
Id: 83127
Status: open
Priority: 0/
Queue: Devel-REPL

People
Owner: Nobody in particular
Requestors: iam [...] stevenolte.com
Cc: iam [...] stevenolte.com
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: "Steve Nolte" <iam [...] stevenolte.com>
Subject: Devel::REPL::Plugin::LexEnv - referencing a scalar
Download (untitled) / with headers
text/plain 585b
On Mon, Feb 04, 2013 at 03:18:20PM -0600, Steve Nolte wrote: Show quoted text
> Greetings! > > I would like to create a script that exposes a scalar I already have > instantiated into a REPL shell. > https://metacpan.org/module/Devel::REPL::Plugin::LexEnv seems really > close, but how do I reference the scalar that already exists without > recreating it in the CODEZ block? > > Thanks, > Steve Nolte
Good question! I am cc-ing your question to the ticket queue so the (real) authors can see it, as I haven't really used Devel::REPL much myself - I've simply released the last few bug fixes :)
Download (untitled) / with headers
text/plain 596b
Sending Steve's reply back to the ticket: Show quoted text
> Hi Karen, > Thanks for creating the ticket. I crawled through some of the > examples in the Lexical::Persistence module and found that this is > possibly doing what I want: > > my $repl = Devel::REPL->new(); > $repl->load_plugin($_) for qw/History DataPrinter LexEnv/; > $repl->lexical_environment->set_context( _ => { '$schema' =>
$self->_schema } Show quoted text
> ); > $repl->run; > > > The underscore notation is a bit confusing... but I'm guessing it's > the convention I need to follow in order to get inject a scalar named > '$schema' into my REPL shell.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.