in reply to Re^2: How a web server sending data to a CGI perl script ?
in thread How a web server sending data to a CGI perl script ?

$ cat shabba for my $key ( grep /perl/i , keys %ENV ){ print qq{ $key $ENV{$key}\n} +; } $ perl shabba PERL_MB_OPT --config installhtmldir= --binhtml= $ perl -e " $ENV{PERL_SHABBA}=666; system $^X, q{shabba}; " PERL_SHABBA 666 PERL_MB_OPT --config installhtmldir= --binhtml= --config installht +mldir= --binhtml= $ perl shabba PERL_MB_OPT --config installhtmldir= --binhtml=

Replies are listed 'Best First'.
Re^4: How a web server sending data to a CGI perl script ?
by exilepanda (Friar) on Jan 26, 2016 at 17:00 UTC
    Oh Wow!! Surprised!!! Great demonstration and works perfectly! And I just notice the system() or the backticks ( the right tool for my case ) are actually kind of fork thing... which is the "how" that I exactly asking! Thanks man!

    Though.. what still puzzle me is how do you leave the <STDIN> open for the CGI to read() in this code pattern ?

      Its not a pattern, just shows %ENV is inherited from parent process

      Its one part of what HTTP::Request::AsCGI does, STDIN... stuff is the other part