#!/usr/local/bin/perl -w
###########################################
# readline-test
# Mike Schilli, 2010 (m@perlmeister.com)
###########################################
use strict;

use Term::ReadLine;
my $term = Term::ReadLine->new("myapp");

while (1) {
  my $input = $term->readline("input>");
  last unless defined $input;
  print "Input was '$input'\n";

  if($input =~ /\S/) {
    $term->addhistory($input);
  }
}
