in reply to command interpreter

I stumbled upon code pl.pl in BrowserUk's scratchpad and have modified it since:
#!/usr/bin/perl # modified from BrowserUk's pl.pl # http://www.perlmonks.org/?viewmode=public;node_id=358718 use strict; use Dumpvalue; use Data::Dumper; use Benchmark ':all'; $| = 1; # autoflush buffers my $__code; my @_ret = undef; while (1) { # print status of evaluation print "#--------------------------------------------------------- +---\n"; print "# return: \n"; Dumpvalue->new->dumpValue(\@_ret); print "#=========\n"; chomp($@); print "# \$@ $@\n" if $@; if ($?) { $! = $_ret[0] = ($? >> 8); print "# \$! [$_ret[0]] $!\n"; print "# SIG [" . ($? & 127) . "]" . (($? & 128) ? " (coredum +p)" : "") . "\n"; } print "#--------------------------------------------------------- +---\n\n"; printf "[eval] "; # prompt # accumulate code to evaluate $__code = ""; $__code .= <STDIN> until $__code =~ m/;;$/; # end accumulation wit +h ;; chomp($__code); # reset error variables $@ = ""; $? = 0; # evaluate the code! if ($__code =~ m/^(.+);;;$/s) # system command with ;;; { @_ret = system($1); $? = 0 if $? == -1; } else { @_ret = eval($__code); } # ctrl-c to quit } exit(0);
End your input with either ;; to eval() or ;;; to system() it out.

You may also want to look at: perl -de ''