[EMAIL PROTECTED] wrote: > Yesterday I posted a question regarding a perl script running under > xinetd on linux. I have received no responses. Perhaps > my question was unclear. I will try to rephrase my problem. > > Xinetd listens on a udp port. When it receives a datagram, it forks and > execs my perl code. > The perl code should be able to read from STDIN using <STDIN> and > retrieve the datagram content received by xinetd. > I am unable to get this to work with the perl code. > > If I write a C code program and use, > > recvfrom(0, dg, sizeof(dg), 0, &newhost, &slen) > > This will work and receive the datagram content. I have tried the perl > function recv() operating on STDIN and that does > not work either. >
have you try reopening STDIN,STDOUT and STDERR to the socket? for example: #!/usr/bin/perl -w use strict; use IO::Handle; use IO::Socket; my $sock = create_my_socket; STDIN->fdopen($sock,"<") || die $!; STDOUT->fdopen($sock,">") || die $!; STDERR->fdopen($sock,">") || die $!; #-- #-- now reading/writing from/to STDIN,STDOUT,STDERR #-- should be coming from/to your socket #-- __END__ david -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]