http://qs1969.pair.com?node_id=499059

tomazos has asked for the wisdom of the Perl Monks concerning the following question:

I've been required to learn a non-Perl Perl-like language at work to integrate a system written in it with a Perl system.

One thing I noticed is the interactive-mode of its interpreter. I think it borrowed this idea from the functional languages that it seems to have a lot of features from.

In short you get a shell-like prompt ">>> " where you can enter an expression or statement. It then evaluates it and returns a human-readable version of its value.

It also stores previous declarations and values in the current environment. For Perl it might look something like this:

>>> my $x = 3 3 >>> $x + 2 5 >>> if ($x > 2) { ... print "hello\n"; ... } hello >>> $x $x ^ Syntax error >>> $x + $x 6

I think we have stuff like this already. eg perl -e. The perl debugger. I've also seen here, people rolling there own 20 line scripts to do something similiar.

My question is what is in your opinion, the best way to setup an Interactive Perl Interpreter, and what are the options for pre-rolled ones (eg from CPAN or elsewhere)?

-Andrew.