X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=blobdiff_plain;f=bin%2Fremoterepl;fp=bin%2Fremoterepl;h=f7bae7a7f83e30f14bd7c61da89cac77dbcb3332;hp=0000000000000000000000000000000000000000;hb=84b04178bd25e342d7f522e8f60c6d695b09576a;hpb=542d5b5ca3990695be389d0d497883876c189486 diff --git a/bin/remoterepl b/bin/remoterepl new file mode 100755 index 0000000..f7bae7a --- /dev/null +++ b/bin/remoterepl @@ -0,0 +1,29 @@ +#!/usr/bin/env perl + +use strictures 1; +use Object::Remote; +use Eval::WithLexicals; +use Term::ReadLine; +use Data::Dumper; + +$SIG{INT} = sub { warn "SIGINT\n" }; + +{ package Data::Dumper; no strict 'vars'; + $Terse = $Indent = $Useqq = $Deparse = $Sortkeys = 1; + $Quotekeys = 0; +} + +#{ no warnings 'once'; $Object::Remote::Connection::DEBUG = 1; } + +my $eval = Eval::WithLexicals->new::on($ARGV[0]); + +my $read = Term::ReadLine->new('Perl REPL'); +while (1) { + my $line = $read->readline('re.pl$ '); + exit unless defined $line; + my @ret; eval { + local $SIG{INT} = sub { die "Caught SIGINT" }; + @ret = $eval->eval($line); 1; + } or @ret = ("Error!", $@); + print Dumper @ret; +}