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; } ...
In reply to Re^3: pass ARGV to STDIN
by almut
in thread pass ARGV to STDIN
by icylisper
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |