in reply to Re^2: pass ARGV to STDIN
in thread pass ARGV to STDIN

Why make things more complicated than they are? If the idea is to send commandline arguments to the server, then just send them (as you would in the parent) and don't read from STDIN — or maybe read from STDIN only if nothing is specified on the commandline, e.g. like this:

... #the child process else { unless (@ARGV) { # read a line from stdin, if no args given on command line my $line = <STDIN>; chomp $line; push @ARGV, split(' ', $line); } print $socket "$_\n" for @ARGV; } ...

Replies are listed 'Best First'.
Re^4: pass ARGV to STDIN
by icylisper (Initiate) on Mar 08, 2008 at 14:27 UTC
    Thats smart and works :) Thanks a ton!