develooper Front page | perl.perl5.porters | Postings from April 2019

[perl #133969] REPL

Thread Next
From:
Steven Penny
Date:
April 3, 2019 20:13
Subject:
[perl #133969] REPL
Message ID:
rt-4.0.24-15387-1554083256-1735.133969-75-0@perl.org
# New Ticket Created by  Steven Penny 
# Please include the string:  [perl #133969]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=133969 >


Perl 5 currently does not have a REPL that I am aware of:

https://wikipedia.org/wiki/Read–eval–print_loop

Several other languages offer this, such as:

- Python
- Ruby
- Julia
- Tcl

I found some workaround, but none of them are ideal. Can use perldebug:

    perl -d -e 0

but it requires manual printing. Can use eval:

    perl -E 'while (<STDIN>) {say eval}'

but it fails with pragmas:

https://github.com/mklement0/perli/issues/3

Can use Devel::REPL, but it fails with standard input:

    $ echo 2+3 | re.pl
    $
    $ echo 2+3 | re.pl -
    $
    $ echo 2+3 | re.pl /dev/stdin
    $

Can use "Reply", but no multiline support:

https://github.com/doy/reply/issues/50


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About