perl -de 42
Not only does this give a(n unprompted) command evaluator,
it also exposes the symbol table and variable values,
permits stack backtraces, and allows for breakpoints.
#!/usr/bin/perl
print ":-) ";
while (<>) { print eval; print ( ($@ || "\n") . ":-)" ) }
There are slightly more elaborate forms in the standard distribution
and elsewhere.
Cameron
Laird's personal notes on interactive
Perl/claird@phaseit.net