my $TIOCSTI = 0x5412; do 'sys/ioctl.ph' and $TIOCSTI = TIOCSTI(); for my $c (split //, "exit\n") { ioctl(STDIN, $TIOCSTI, $c) or die $!; }