initial import
[p5sagit/Eval-WithLexicals.git] / bin / tinyrepl
CommitLineData
6f914695 1use strictures 1;
2use Eval::WithLexicals;
3use Term::ReadLine;
4use Data::Dumper::Concise;
5use Try::Tiny;
6
7my $eval = Eval::WithLexicals->new;
8my $read = Term::ReadLine->new('Perl REPL');
9while (1) {
10 my $line = $read->readline('re.pl$ ');
11 exit unless defined $line;
12 my @ret; try {
13 local $SIG{INT} = sub { die "Caught SIGINT" };
14 @ret = $eval->eval($line);
15 } catch {
16 @ret = ("Error!", $_);
17 };
18 print Dumper @ret;
19}