fix comments that were in wrong spot from refactoring
[scpubgit/Object-Remote.git] / bin / remoterepl
CommitLineData
84b04178 1#!/usr/bin/env perl
2
3use strictures 1;
4use Object::Remote;
5use Eval::WithLexicals;
6use Term::ReadLine;
7use Data::Dumper;
8
9$SIG{INT} = sub { warn "SIGINT\n" };
10
11{ package Data::Dumper; no strict 'vars';
12 $Terse = $Indent = $Useqq = $Deparse = $Sortkeys = 1;
13 $Quotekeys = 0;
14}
15
16#{ no warnings 'once'; $Object::Remote::Connection::DEBUG = 1; }
17
8892aa5c 18my $eval = Eval::WithLexicals->new::on($ARGV[0]||'-');
84b04178 19
20my $read = Term::ReadLine->new('Perl REPL');
21while (1) {
22 my $line = $read->readline('re.pl$ ');
23 exit unless defined $line;
24 my @ret; eval {
25 local $SIG{INT} = sub { die "Caught SIGINT" };
26 @ret = $eval->eval($line); 1;
27 } or @ret = ("Error!", $@);
28 print Dumper @ret;
29}