perlquestion
spx2
Hello,
<p>
I'm playing around with Catalyst and since there's this really good module on CPAN
called [cpan://Devel::REPL] and an extension for Catalyst called [cpan://CatalystX::REPL]
I gave it a spin.</p><p> I also had some problems installing Devel::REPL, [https://rt.cpan.org/Ticket/Display.html?id=67811|but I managed to fix that too].
</p>
<p>
However, I wasn't able to get CatalystX::REPL working after following all the instructions in
the documentation. I was just not getting any cursor, Devel::REPL wasn't firing up.
</p>
<p>
So I had to make my own small hack and so here goes the code I wrote in an action to get
a REPL:
<c>
use Devel::REPL;
...CATALYST CODE...
sub action_name {
my ($self,$c) = @_
...
########### Devel::REPL break
$Devel::REPL::Plugin::Packages::DefaultScratchpad::ctx = $c;
my $repl = Devel::REPL->new;
$repl->load_plugin($_) for qw(History LexEnv Packages PPI);
$repl->eval('my $c = $Devel::REPL::Plugin::Packages::DefaultScratchpad::ctx;');
$repl->eval('warn "\n\n[USE \$c from Catalyst!!]\n\n;";');
$repl->run;
###########
....
}
</c>
I wanted to ask if there's someone who was able to get CatalystX::REPL working and what settings did you use, maybe there was something I missed.
</p>
<p>
Thanks,<br/>
Stefan
</p>