Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: CGI scoping question

by poj (Abbot)
on May 10, 2019 at 18:05 UTC ( [id://1233569]=note: print w/replies, xml ) Need Help??


in reply to CGI scoping question

Why would index not be 10

Perhaps $q is not defined, add this line to check

die "\$q not defined" unless defined $q; my $index = $q->param('orderby');
poj

Replies are listed 'Best First'.
Re^2: CGI scoping question
by WoodyWeaver (Monk) on May 10, 2019 at 18:22 UTC
    I'm using $q in the global, so having it vanish in the subroutine would be interesting indeed. Added that check line, but no joy. Just now I had a case where
    <li><strong>orderby</strong></li> <ul> <li>10</li> </ul> <li><strong>desc</strong></li> <ul> <li>1</li>
    yet
    <!-- variables (index, desc) are (10, ) -->
    The previous instance of the CGI variable would have correctly had the desc parameter undefined, but *this* one seems to be set.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1233569]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-18 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found