Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

/ instead of ?

by Sinister (Friar)
on Apr 26, 2001 at 15:57 UTC ( #75751=perlquestion: print w/replies, xml ) Need Help??

Sinister has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to find a decent way to replace the ? for a / when commiting parameters to a CGI script. It works, but my webserver seems to like these slashes as well and interprets them as 'go to site root'. Which my CGI script doesn't like.

Is there a pre-fixed solution for this, (module / craft) or shall we brain-storm?

Sinister greetings.

Replies are listed 'Best First'.
Re: / instead of ?
by snowcrash (Friar) on Apr 26, 2001 at 16:34 UTC
    look for path_info() in perldoc CGI. Also check out Merlyn's column on that one.

    snowcrash //////
Re: / instead of ?
by arturo (Vicar) on Apr 26, 2001 at 16:37 UTC

    What I think you may be looking for(*) is PATH_INFO, which is a value that your webserver will pass to a script when that script is the last thing the server can find ON the path, but not at the end of the path.

    An example might make this clearer: Suppose I have a script called in my cgi-bin directory. Now suppose the server gets a request for


    There is no file at the end of that path, so it backs up until it finds something that *does* exist, namely, and passes all the "extra" stuff to that as PATH_INFO, i.e. $ENV{PATH_INFO} is set to


    Does that help?

    * OK, I'm sure merlyn's written an article about this that will tell you more than I just have, and I'm reasonably confident he'll give you the URL once he sees your node =) But this should get you started.

Re: / instead of ?
by zigster (Hermit) on Apr 26, 2001 at 16:20 UTC
    The ?'s are part of the http protocol your webserver is interpretting them correctly. Maybe if you explain the problem behind the problem we could help futher. Why do you want to do this?

Re: / instead of ?
by diarmuid (Beadle) on Apr 26, 2001 at 17:19 UTC
    could you post the relevant section of your code

      Hear, hear!

      All is well. Made a bl##dy mistake in one of the regexxes...

      problem solved...

      Sinister greetings.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://75751]
Approved by root
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2022-05-20 03:51 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (72 votes). Check out past polls.