Hi, all I'm trying to do a terminal-like application in perl5.
There is a serial-coupled box, which i try to handle. I used minicom, works fine, but i have to set some filters and controls for in- and output. So i tried following: #!/usr/bin/perl -w use English; my ($kidpid, $lines, $liner, $port, $oldh); unless (@ARGV == 1) { die "usage: $0 ttySx" } ($port) = @ARGV; open(BOX, "+>/dev/$port") or die "can't connect to >/dev/$port $!"; $OUTPUT_AUTOFLUSH = 1; # split the program into two processes, identical twins die "can't fork: $!" unless defined($kidpid = fork()); # the if{} block runs only in the parent process if ($kidpid) { # print STDERR "[pa Child#: $kidpid Parent#: $$]\n"; #debug only # copy standard input to the BOX while (defined ($lines = <STDIN>)) { print "**s** $lines"; #deb: line sent print BOX $lines; if ($lines eq "exit\n") { kill("TERM",$kidpid); # send SIGTERM to child close(BOX); exit 0; } } } # the else{} block runs only in the child process else { # print STDERR "[ch Child#: $kidpid Parent#: $$]\n"; #debug only # copy BOX to standard output while (1){ $liner = <BOX>; print STDOUT "**r** $liner"; # deb: line received } } There seems to be some confusion between input- and outputbuffer. I get ati0 **s** ati0 **r** ati0 **r** **r** **r** Xircom CreditCard Modem CM-56T (Revision 2.08) **r** **r** **r** **r** OK **r** **r** ati0 **r** **r** **r** Xircom CreditCard Modem CM-56T (Revision 2.08) **r** **r** **r** **r** OK **r** ... Does somebody know, what i'm doing wrong? Is somewhere a perl-list? Matth