in reply to CGI with nested apps, each calling param() to get their args
This behavior is naively unexpected by me; can somebody please explain this mechanism?
You're expecting too much from a debugging feature of CGI.pm
The CGI protocol communicates through %ENV , and each child process gets the same %ENV as parent process, so to CGI.pm won't use the debugging freature and look at @ARGV
But since CGI programs don't populate @ARGV you can use
#!/usr/bin/perl -- use strict; use warnings; use CGI (); Main( @ARGV ); exit( 0 ); sub Main { my $cgi = @_ ? CGI->new(@_) : CGI->new; }
Or it might be prudent to use GetOpt::Long / --query=a=1;b=2;c=3... instead of testing only for @ARGV
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CGI with nested apps, each calling param() to get their args
by Zforgetaboutit (Initiate) on Oct 12, 2012 at 14:34 UTC | |
by Anonymous Monk on Oct 13, 2012 at 15:48 UTC |