如何启动Perl的交互式控制台,类似于Ruby的irb命令或python的python命令?


当前回答

re.pl来自Devel::REPL

其他回答

Sepia和PDE也有自己的reps(用于GNU Emacs)。

还可以在CPAN上查找ptkdb: http://search.cpan.org/search?query=ptkdb&mode=all

Read-eval-print循环:

$ perl -e'while(<>){print eval,"\n"}'

如果需要历史记录,请使用rlwrap。这可以是你的~/bin/ips,例如:

#!/bin/sh
echo 'This is Interactive Perl shell'
rlwrap -A -pgreen -S"perl> " perl -wnE'say eval()//$@'

这是它的样子:

$ ips
This is Interactive Perl shell
perl> 2**128
3.40282366920938e+38
perl> 

你可以在网上做这件事(就像生活中的许多事情一样):

https://www.tutorialspoint.com/execute_perl_online.php