📜 ⬆️ ⬇️

REPL for Perl

Unfortunately, perl, for all its merits, has one significant
disadvantage - unlike the same python, the perl interpreter does not provide
boxes full-weight REPL. REPL allows you to enter commands in a step-by-step mode, which
often useful when performing semi-automated testing. Or if you
Sacredly sure that that small piece of code that you want to jot down for
solving the momentary problem, you will never need it again. At the moment in
There are 3 main options for implementing REPL. Each with their own
advantages and disadvantages.


Ordinary debugger

What we get on command:

perl ‐d ‐e 1 

')
It is a debugger for its intended purpose, and the fact that you will use it as a REPL will remain
on your conscience. Suitable when there is nothing at hand - this method does not require
installation of any additional modules. Of the minuses - lack of support
multi-line commands and a bunch of small differences from full-fledged perl, which are easier
feel yourself rather than articulate.


Module Devel :: REPL.

You get a full-fledged REPL with chips and frills. If you wait until
all dependencies will be established. In case of successful installation, you will get everything:

- TAB autocompletion for keywords, variables, functions, etc.

- input multi-line blocks. On many lines

- command history, saved from session to session

- startup speed comparable to the Groovy interpreter

- highlight text

This miracle is started by the command re.pl.


Module Reply.

Much less dependencies than the previous version, but not much less
opportunities. Of the tangible - you can not enter multi-line blocks, although for
This has the ability to call an external editor. From useful features - is
the ability to reload all modules before executing each command, which, if
correct use speeds up the debugging process compared to multiple
run through a regular debugger.

Run by the reply command.

Source: https://habr.com/ru/post/187222/


All Articles