in reply to Re^2: CGI scoping question
in thread CGI scoping question

Several parameters are being set through classical forms
...
This orderby and desc fields are not
If you are sending a form to your script then the parameters in the URL are not available to CGI's param(). You need to use url_param()
my $index = $q->url_param('orderby');

Replies are listed 'Best First'.
Re^4: CGI scoping question
by WoodyWeaver (Monk) on May 10, 2019 at 18:57 UTC
    (Bows head) Fascinating, and an issue I would not have guessed. http://127.0.0.1/id/bin/example.pl?exec=list&table=users&orderby=10 has lines
    my $index_url = $q->url_param('orderby'); my $index = $q->param('orderby'); my $desc_url = $q->url_param('desc'); my $desc = $q->param('desc');
    and produces <!-- variables (index, desc, index_url, desc_url) are (1, , 10, ) -->. The namespace collision did me in.