#!/usr/bin/perl print "Type exit to exit"; $SIG{INT} = sub {die "Interrupted!";}; while(1) { print "\n> "; my $repl_cmd = ; my @it = eval $repl_cmd; print STDERR $@ if $@; print (join ',', @it); # if it ne undef }