develooper Front page | perl.beginners | Postings from June 2003

Re: Quick CGI query_string() question

Thread Previous | Thread Next
From:
R. Joseph Newton
Date:
June 21, 2003 13:11
Subject:
Re: Quick CGI query_string() question
Message ID:
3EF4BDB3.434F0629@efn.org
Dan Muey wrote:

> Hello list,
>
> I have a probably simple thing.
>
> I'd like to basically do:
>
> use CGI qw(:standard);
> my $q = query_string();
>
> Except I need to remove two params from it:
>
> So if $q above is : hi=bye&love=hate&one=two&etc=etc

Hmmm.  Do you work for the State Department or something?  Or the
White House Press office?

>
> I want to remove, say 'love', so it'd be: hi=bye&one=two&etc=etc
>
> I know I could do a regex but I'd like a CGI way to do

Why mess with it?  If you need a string without the particular
parameters, you could easily regex them out:in the variable itself,
but the query string of the CGI object is basically meant as a
read-only attribute.  Why not just work with the variable $q?  Since
the CGI module is basically object-oriented, the CGI way to do it
would be to just let the internals of the CGI object be, use what
you need, and leave the rest.

It would probably help to know what actual effect you are trying to
achieve that you see as requiring manipulation of the query string.

Joseph


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About