#!/usr/bin/perl -wn BEGIN { sub cl { print `clear` } # i like a clear screen sub q { exit 0 } # i like a simple exit $SIG{$_} = 'IGNORE' for keys %SIG; print "\n\tType\e[1m exit\e[0m when you are ready to stop.\n"; $history = 1; sub prompt { print "\n", $ENV{USER}, '@perl-shell[', $history++, ']>'; } prompt(); } eval; $@ ne "" and warn $@; # give perl errors back to the user prompt(); # print a fresh prompt with updated history END { print "\n\t\tBye!\n\n"; }