=pod Code submission from: Philip L. Robare (probare@shrike.depaul.edu) A Perl interactive shell program. This little bit of code allows you to test out one-liners and regular expressions to quickly see if they do what you think they do. Upon entry a prompt ("perl> ") is presented and you may type any perl expression. When Enter is pressed the expression is handed over to "eval" and the results come back to you. Any error messages are echoed. Assignments become part of the execution environment so that you may assign on one line and test the variable's value on another. Any line starting with a question mark is transformed into a print statement. A previous line may be re-entered with the prompt still attached and it will be stripped off. This allows triple clicking to copy the line and re-execute it. Exit the script by typing "exit". This will be passed to eval which will then exit. Example: perl> $a="This is a test" perl> if ($a =~ /test/) { print "Test found"; } else { print "Test not found"} Test found perl> $a="This is practice" perl> perl> if ($a =~ /test/) { print "Test found"; } else { print "Test not found"} Test not found perl> ?$a This is practice perl> exit =cut # Phil Robare, Chicago IL, USA $prompt="perl> "; print "Perl Interpretive Shell - type exit to leave\n\n"; print $prompt; while(<>) { s/^$prompt//; # previous line is cut & pasted - ignore prompt s/^\?/print /; # a question mark as the first char becomes "print" eval; warn $@ if $@; # print out any error messages print "\n$prompt"; }