Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: •Re: Interesting query_string behavior

by Hero Zzyzzx (Curate)
on Aug 13, 2002 at 18:30 UTC ( #189910=note: print w/replies, xml ) Need Help??

in reply to •Re: Interesting query_string behavior
in thread Interesting query_string behavior

This behavior does seem consistent with how the rest of works.

For some reason I had it in my head that methods like query_string() and script_name() were just convenience methods for getting %ENV values, but this isn't the case. Fine with me, because this is a very nice feature. . .The docs were just a bit confusing as to what was actually returned from query_string().


-Any sufficiently advanced technology is
indistinguishable from doubletalk.

  • Comment on Re: •Re: Interesting query_string behavior

Replies are listed 'Best First'.
Re: Re: •Re: Interesting query_string behavior
by mfriedman (Monk) on Aug 13, 2002 at 19:10 UTC
    Indeed. It even becomes clearer when we look at the code. :)

    #### Method: query_string # Synthesize a query string from our current # parameters #### 'query_string' => <<'END_OF_FUNC', sub query_string { my($self) = self_or_default(@_); my($param,$value,@pairs); foreach $param ($self->param) { my($eparam) = escape($param); foreach $value ($self->param($param)) { $value = escape($value); push(@pairs,"$eparam=$value"); } } return join($USE_PARAM_SEMICOLONS ? ';' : '&',@pairs); }

    - from

    So it simply constructs a query string from the given name/value pairs already in the CGI object. It'll even use that far-out semicolon format if you want it to. :)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2021-05-14 23:00 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (150 votes). Check out past polls.