Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 24 lines (21 sloc) 547 Bytes
#!/usr/bin/env perl
use 5.10.0;
use FindBin;
BEGIN { unshift @INC, $FindBin::Bin if -s "$FindBin::Bin/STD.pmc"; }
BEGIN { $ENV{STD5DEBUG} = -1; }
use STD;
use utf8;
use YAML::XS;
use Encode;
use Term::ReadLine;
my $term = new Term::ReadLine 'STD non-repl';
my $prompt = " ";
my $OUT = $term->OUT || \*STDOUT;
while ( defined ($_ = $term->readline($prompt)) ) {
my $text = Encode::decode("UTF-8", $_);
my $r = eval { STD->parse($text) };
print $@ if $@;
say "ok" if $r;
say "\n\n\n";
$term->addhistory($_) if /\S/;
}