#!/usr.bin/perl
use IO::Tty ;
   use IO::Pty;

    $pty = new IO::Pty;

    $slave  = $pty->slave;

    foreach $val (1..10) {
        print $pty "$val\n";
        $_ = <$slave>;
        print "$_";
    }

    close($slave);
