Devel:...:LexEnv(3pm)

πŸ“¦
version 1.003029 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Devel::REPL::Plugin::LexEnv β€” bestie, it literally provides a lexical environment for the REPL 🫢

It's the plugin that hands your REPL a real, actual lex env so the stuff you use and the vars you my stay alive between lines. It's giving "I got you" energy, fr fr.


✨ VERSION ✨

This is version 1.003029 β€” that's the one, no cap πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

okay so here's the whole vibe, copy it exactly, don't freestyle it:

# in your re.pl file:
use Devel::REPL;
my $repl = Devel::REPL->new;
$repl->load_plugin('LexEnv');

$repl->lexical_environment->do(<<'CODEZ');
use FindBin;
use lib "$FindBin::Bin/../lib";
use MyApp::Schema;
my $s = MyApp::Schema->connect('dbi:Pg:dbname=foo','broseph','elided');
CODEZ

$repl->run;

# after you run re.pl:
$ warn $s->resultset('User')->first->first_name # <-- note that $s works

Like. The $s you declared inside that heredoc? It survives. It shows up in your REPL like it never left. That's the whole point and it's lowkey iconic πŸ’…


🌸 SUPPORT 🌸

Found a bug? Don't suffer in silence bestie 😭 β€” submit it through the RT bug tracker here:

https://rt.cpan.org/Public/Dist/Display.html?Name=Devel-REPL

or, if email is more your thing:

bug-Devel-REPL@rt.cpan.org β€” that's <mailto:bug-Devel-REPL@rt.cpan.org> in mailto form πŸ’Œ

There's also an irc channel for users of this distribution, and it lives at "#devel" on "irc.perl.org" β€” aka <irc://irc.perl.org/#devel-repl>, come hang out, the vibes are immaculate 🌈


πŸ‘‘ AUTHOR πŸ‘‘

Matt S Trout β€” mst (at) shadowcatsystems.co.uk

and his corner of the internet: http://www.shadowcatsystems.co.uk/ β€” that's <http://www.shadowcatsystems.co.uk/> if you wanna click it πŸ’–


This software is copyright (c) 2007 by Matt S Trout - mst (at) shadowcatsystems.co.uk (http://www.shadowcatsystems.co.uk/).

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Slay, honestly 🧚


and that's the whole page, bestie ✨ this was Devel:...:LexEnv(3pm) from perl v5.34.0, dated 2022-06-03 β€” go forth and lexically scope, mwah πŸ’‹

πŸ“¦ where this page comes from