Devel:...istory(3pm)
π Devel::REPL::Plugin::ReadLineHistory π
okay bestie come closer because this one is a 3pm page, i.e. it lives in the User Contributed Perl Documentation section, and it's genuinely such a glow-up for your REPL. let's go π«Ά
β¨ NAME β¨
Devel::REPL::Plugin::ReadLineHistory β it integrates your history with all the cute facilities that Term::ReadLine hands you. that's the whole job. she does it well. π
πΈ VERSION πΈ
version 1.003029
like. that's the version. write it down. π
π¦ DESCRIPTION π¦
so this plugin lets you load and save command line history from a file, and it also does history expansion of previous commands using the !-syntax, Γ la bash. it's giving time travel but make it terminal. β
By default, history expansion is enabled with this plugin when using Term::ReadLine::Gnu. and that means "loose" ! characters will be treated as history events β which may not be what you wish. π like, she's eager. she's reading your punctuation. she thinks every ! is a command.
so if you have a ! that's just vibing there and not meant as a history event, you have to deal with it. no cap.
to avoid that, you need to quote the ! with \:
my $var = "foo\!";
or, alternatively, you can place the arguments in single quotes β but only if you also enable the Term::ReadLine attribute history_quotes_inhibit_expansion:
$_REPL->term->Attribs->{history_quotes_inhibit_expansion} = 1;
my $var = 'foo!';
and if you wanna just straight up disable history expansion from GNU readline/history, you do:
$_REPL->term->Attribs->{do_expand} = 0;
that's it. that's the switch. π₯
π CONFLICTS π
not to be dramatic but: Term::ReadLine::Perl does not support a history expansion method. so in that case, you may wish to use the Devel::REPL History plugin instead, which provides similar functions. π«Ά
Work is underway to make use of either History or ReadLineHistory> consistent for expansion with either the Term::ReadLine::Gnu support or Term::ReadLine::Perl. (yes we're all waiting. we're patient. we're hydrated. π)
π SUPPORT π
got bugs? bestie, submit them. π
- Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=Devel-REPL> (or
bug-Devel-REPL@rt.cpan.org<mailto:bug-Devel-REPL@rt.cpan.org>). - There's also an irc channel available for users of this distribution, at
#develonirc.perl.org<irc://irc.perl.org/#devel-repl>.
π AUTHOR π
Matt S Trout - mst (at) shadowcatsystems.co.uk (<http://www.shadowcatsystems.co.uk/>)
the main character, honestly. π
π COPYRIGHT AND LICENCE π
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. π
and that's the whole page, bestie!! this one came from perl v5.34.0, dated 2022-06-03, and it's the Devel:...istory(3pm) situation we all know and love β okay love u bye, go write some history πβ¨π§
π¦ where this page comes from
- debian bookworm: libdevel-repl-perl 1.003029-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libdevel-repl-perl 1.003029-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdevel-repl-perl 1.003029-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdevel-repl-perl 1.003029-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdevel-repl-perl 1.003029-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms