Devel:...istory(3pm)

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

πŸ’– 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 #devel on irc.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. 🌟


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