#!/usr/bin/perl

use Term::ReadLine;

my  $term = new Term::ReadLine 'Perl Interpreter';
$prompt = "Type the perl command: ";

$OUT = $term->OUT || STDOUT;
select $OUT;
while (defined ($v = $term->readline($prompt)) ) {
  if ($v =~ s/^inic//) {
    while (defined ($_ = $term->readline(":::")) ) {
      last if /^fim/;
      $v .= "$_\n";
    }
  }
  eval($v);
  warn $@ if $@;

  for $p (split "\n",$v) {
    $term->addhistory($p) if ($p=~ /\S/);
  }
#  print "\n";
}


