passing param('something') through a function

S

steve_f

When using CGI.pm, I am getting funny results...

this works:

param('mkt') ?
$html =~ s/%mkt%/param('mkt')/e :
$html =~ s/%mkt%/us/;

but here:
$html =~ s/%menu%/make_menu($mkt)/e;

and here:
print $socket get_request($keyword, $mkt);

I need to set $mkt = param('mkt') or the function doesn't
work...any ideas?

TIA
 
S

steve_f

When using CGI.pm, I am getting funny results...

this works:

param('mkt') ?
$html =~ s/%mkt%/param('mkt')/e :
$html =~ s/%mkt%/us/;

but here:
$html =~ s/%menu%/make_menu($mkt)/e;

and here:
print $socket get_request($keyword, $mkt);

I need to set $mkt = param('mkt') or the function doesn't
work...any ideas?

TIA

oh man...sorry...maybe I am wrong about this...maybe
my code is just buggy! ;-)
 
S

steve_f

ok...sorry for double posting to my own thread ;-)

can CGI.pm use both POST and GET together?
I think that was the problem...by this I mean using
POST and also adding a query string on the url

my_script.cgi?something=value
 
A

Alan J. Flavell

can CGI.pm use both POST and GET together? [...]
my_script.cgi?something=value

Well, its documentation (which you've obviously already consulted
before deciding to pose the question, right?) told you that it could.
So what's your question, really? The problem, as I see it, is that
the underlying specifications don't clearly entitle one to use that.
So if it fails to work, it's not CGI.pm's fault for trying to offer
the option, but the underlying specs for failing to guarantee that
it'll work.

More to the point, what are you trying to achieve? Maybe there's a
better solution to your problem, that doesn't involve such iffy
technical details. That's often the best approach to such arcane
questions of detail, IMHO.
 
S

steve_f

can CGI.pm use both POST and GET together? [...]
my_script.cgi?something=value

Well, its documentation (which you've obviously already consulted
before deciding to pose the question, right?) told you that it could.
So what's your question, really? The problem, as I see it, is that
the underlying specifications don't clearly entitle one to use that.
So if it fails to work, it's not CGI.pm's fault for trying to offer
the option, but the underlying specs for failing to guarantee that
it'll work.

More to the point, what are you trying to achieve? Maybe there's a
better solution to your problem, that doesn't involve such iffy
technical details. That's often the best approach to such arcane
questions of detail, IMHO.

Sorry again...I should of read the documentation. What I was trying
to achieve is to send some options through the query and some through
the POST method.

So....basically config type options are attached to the query...well...maybe
I really could just use a hidden tag instead. I think I was thinking it was
fun to do both, but I guess I could make it easier for myself.

Thanks,

Steve
 
A

Alan J. Flavell

So....basically config type options are attached to the
query...well...maybe I really could just use a hidden tag instead. I
think I was thinking it was fun to do both, but I guess I could make
it easier for myself.

You've still got the PATH_INFO available (for any server that supports
the CGI specification - which AIUI excludes MS's IIS from
consideration).

But this is a CGI issue, rather than a Perl language matter. CGI.pm
certainly supports that; but the underlying technology would be better
discussed, if need be, on an appropriate CGI group, viz.
comp.infosystems.www.authoring.cgi (beware the automoderation bot).

hope that helps
 
R

Richard Gration

"Bill said:
Yes. See the documentation, "MIXING POST AND URL PARAMETERS" --

And if you want a little giggle, search CGI.pm for the word 'cake' ;-)

R
 
S

steve_f

You've still got the PATH_INFO available (for any server that supports
the CGI specification - which AIUI excludes MS's IIS from
consideration).

But this is a CGI issue, rather than a Perl language matter. CGI.pm
certainly supports that; but the underlying technology would be better
discussed, if need be, on an appropriate CGI group, viz.
comp.infosystems.www.authoring.cgi (beware the automoderation bot).

hope that helps

yes, thank you. My solution was to use:

(my $query = $ENV{QUERY_STRING}) =~ s/boxes=//;

about posting in other groups, I really should get around
and look at what else is out there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,159
Messages
2,570,880
Members
47,417
Latest member
DarrenGaun

Latest Threads

Top