Reply(3pm)

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

πŸ’– 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_line callback returns undef β€” which, typically, is when the user hits Ctrl+D 😭
  • or the loop callback returns false β€” and by default, the #q command quits the repl this way. πŸ‘‹

πŸ’… step($line, $verbose) πŸ’…

Runs a single iteration of the repl. one (1) step. little baby step. 🐣

  • If $line is given, that string gets used as the thing to evaluate β€” and the prompt and read_line callbacks will not be called. no prompt, no reading, just vibes.
  • If $verbose is 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 with script_line will 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 because Config::INI doesn't support multiple keys with the same name in a section. this may be fixed in the future to just allow specifying script_line multiple 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> πŸ’–


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