in reply to Re: How to parse URL in CGI.pm
in thread How to parse URL in CGI.pm

Thanks for the help!

The URL is coming from outside and I cannot ask the sender to encode it.

So, I think I'll use the ENV{REQUEST_URI} option.

Is this safe? Can I count on it to always give me the correct URI?

Replies are listed 'Best First'.
Re^3: How to parse URL in CGI.pm
by Anonymous Monk on Dec 06, 2010 at 08:31 UTC
    Is this safe? Can I count on it to always give me the correct URI?

    Its safe in the sense that it is only data.

    Since REQUEST_URI is not part CGI spec, it won't be available on every server, so its better to rely on other variables (PATH_INFO/QUERY_STRING...)

      Should there be a problem using the $ENV{'QUERY_STRING'} if the program runs under mod_perl?

        The environment variable is part of the CGI interface. If your script is being provided a CGI interface, it will be present. Otherwise, it won't.

        mod_perl doesn't necessarily present a CGI interface to your module, but it doesn't preclude it either.