Reply(3pm)
π Reply β the read, eval, print, loop situation π
okay bestie so <pink>Reply</pink> is a Perl module, it's in section 3pm, and honestly? it's giving main character energy for your terminal. π
β¨ VERSION β¨
version 0.42 β yeah we're on 0.42, and we're thriving. π
πΈ SYNOPSIS πΈ
look at this. literally three lines. iconic.
use Reply;
Reply->new(config => "$ENV{HOME}/.replyrc")->run;
that's it. that's the whole vibe. π¦
π DESCRIPTION π
NOTE: This is an early release, and implementation details of this module are still very much in flux. Feedback is welcome!
okay so first thing, no cap β this is an early release and the implementation details are still very much in flux. so like, if stuff moves around, that's expected, bestie. and feedback? welcome. they want it. send it. π«Ά
So what is <pink>Reply</pink>? It's a lightweight, extensible REPL for Perl β read, eval, print, loop, and honestly, yay. πβ¨
It's plugin-based (go look at Reply::Plugin if you wanna see the whole ecosystem, iykyk), and through those plugins it supports so many advanced features. like:
- coloring and pretty printing π
- readline support π
- pluggable commands π
it's giving "I built a whole personality around my REPL" and honestly, same.
π§ METHODS π§
β¨ new(%opts) β¨
Creates a new Reply instance. slay. here are the valid options you can pass, bestie:
configβ the name of a configuration file to load. this file should contain INI-style configuration for plugins, exactly as described down in CONFIGURATION. πpluginsβ an arrayref of additional plugins to load. stack 'em up. π§±
π¦ run π¦
Runs the repl. it will keep looping and looping and looping until either:
- the
read_linecallback returnsundefβ which, typically, is when the user hitsCtrl+Dπ - or the
loopcallback returns false β and by default, the#qcommand quits the repl this way. π
π step($line, $verbose) π
Runs a single iteration of the repl. one (1) step. little baby step. π£
- If
$lineis given, that string gets used as the thing to evaluate β and thepromptandread_linecallbacks will not be called. no prompt, no reading, just vibes. - If
$verboseis true, the prompt and the line will be displayed as though they were typed out. as if. fake it till you make it. β¨ - Returns true if the repl can continue, and false if it was requested to quit.
π CONFIGURATION π
so the configuration uses an INI-style format β similar to the configuration format of Dist::Zilla, if you know her. π
Here's how it works, bestie:
- Section names are used as the names of plugins.
- Any options within a section get passed as arguments to that plugin.
- Plugins are loaded in order as they are listed in the configuration file.
β οΈ and that ordering thing matters, okay? it can affect the results in some cases where multiple plugins are hooking into a single callback. (see Reply::Plugin for more information on that whole situation.)
In addition to the plugin configuration, there are some additional options recognized. these must be specified at the top of the file, before any section headers. π
script_fileβ this contains a filename whose contents will be evaluated as perl code once the configuration is done being loaded.script_line<n>β any options that start withscript_linewill be sorted by their key, and then each value will be evaluated individually once the configuration is done being loaded.
NOTE: this is currently a hack π β it exists becauseConfig::INIdoesn't support multiple keys with the same name in a section. this may be fixed in the future to just allow specifyingscript_linemultiple times. so like, don't get too attached to the current shape, bestie. π
π BUGS π
No known bugs. β¨ iconic. flawless. no notes. periodt.
but if you do find one, please report any bugs to GitHub Issues at:
<https://github.com/doy/reply/issues>
π SEE ALSO π
Devel::REPLβ the other one. go say hi. π
π«Ά SUPPORT π«Ά
You can find this documentation for this module with the perldoc command. yes, the classic move:
perldoc Reply
You can also look for information at:
- MetaCPAN
<https://metacpan.org/release/Reply>
- Github
<https://github.com/doy/reply>
- RT: CPAN's request tracker
<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Reply>
- CPAN Ratings
<http://cpanratings.perl.org/d/Reply>
π AUTHOR π
Jesse Luehrs <doy@tozt.net> π
β COPYRIGHT AND LICENSE β
This software is Copyright (c) 2016 by Jesse Luehrs.
This is free software, licensed under:
The MIT (X11) License
and that's the whole page, bestie!! π this was perl v5.34.0, dated 2022-06-17, and that's Reply(3pm) β read, eval, print, loop, yay! π
β¨ go forth and REPL. π¦π
π¦ where this page comes from
- debian bookworm: libreply-perl 0.42-2 Β· MIT
- debian trixie: libreply-perl 0.42-2 Β· MIT
- ubuntu noble: libreply-perl 0.42-2 Β· MIT
- ubuntu resolute: libreply-perl 0.42-2 Β· MIT
- ubuntu stonking: libreply-perl 0.42-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms