Skip Menu |

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

Report information
The Basics
Id: 58279
Status: rejected
Priority: 0/
Queue: Devel-REPL

People
Owner: Nobody in particular
Requestors: smueller [...] cpan.org
Cc:
AdminCc:

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



Subject: LexEnv changes current package
I have an application that's a slightly customized Devel::REPL underneath. Part of the convenience layer is adding a bunch of globals to the main package. This is thwarted by the fact that the evaluated code is run within "Lexical::Persistence" -- at least if that plugin was loaded. Now, it's easy to force the evaluated code into some package by adding a "package main;" to the code generation in LexEnv.pm, but it should ideally be possible to change the package on the command line. One way to work around this would be to inject code that saves caller(0)[0] into some fully specified global $some::where after evaluating the user code. Then when the next line is evaluated, we add the "package $some::where;" statement. Needless to say, that's a horrible kludge. I don't know Lexical::Persistence or Devel::REPL enough to suggest a better course of action. If somebody has any better suggestions, I'd be willing to try to cough up an implementation. Cheers, Steffen
Does Devel::REPL::Plugin::Packages not do it? On Wed Jun 09 13:55:39 2010, SMUELLER wrote: Show quoted text
> I have an application that's a slightly customized Devel::REPL > underneath. Part of the convenience layer is adding a bunch of > globals to the main package. This is thwarted by the fact that > the evaluated code is run within "Lexical::Persistence"... . > > Now, it's easy to force the evaluated code into some package > by adding a "package main;" to the code generation in LexEnv.pm, > but it should ideally be possible to change the package on the > command line. ...
Sorry, no idea how I missed that. Closing as "rejected", ie. not a bug. Thanks for your help! --Steffen