------ test-expect-simple ---- use Modern::Perl; use Expect::Simple; $| = 1; my $obj = Expect::Simple->new({ Cmd => [ midish => '-v'], Prompt => '+ready', DisconnectCmd => 'exit', Verbose => 0, Debug => 0, Timeout => 100 }); sub prompt { print "midish> " } while ( prompt(), my $cmd = ){ exit if $cmd =~ 'quit'; chomp $cmd; $cmd .= "\r"; $obj->send( $cmd ); my @lines = split "\n", $obj->before; splice(@lines, 0, 2); # throw away the first two lines say join "\n", @lines; } __END__ $perl test-expect-simple midish> asdf asdf: no such proc midish> 1234 midish> ffff 3.5: statement or proc definition expected midish> ^C