logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: Fwd: Re: Q: CGI::Application::Dispatch V 2.00_03: msg#00049

Subject: Re: Fwd: Re: Q: CGI::Application::Dispatch V 2.00_03
Just out of curiosity, wouldn't it be better to test with exists()?

I did a quick test using env.pl, which confirms that for me as well, the PATH_INFO variable exists only if there actually is something in the url.
That is:

  http://foo/bar.pl  -> no PATH_INFO exists in %ENV
  http://foo/bar.pl/ -> PATH_INFO = /

This holds both under mod_perl (with ModPerl::Registry) and under mod_cgi. My Apache is 2.0.52.

As an aside, I have distant memories of IIS/5.0 not being able to do path_info at all, at least not without certain arcane rituals too gross to detail here.

Rhesa


#!/usr/bin/perl
# env.pl
print "Content-type: text/plain\n\n";
print map { "$_\t=$ENV{$_}\n" } sort keys %ENV;
# end

Ron Savage wrote:
Hi Michael


(3)
Line 168:
unless(defined $ENV{PATH_INFO}) {
croak "reality checked failed: PATH_INFO is not defined in the
environment"; }


I wrote a tiny CGI script containing:

my($env_path_info)      = defined($ENV{'PATH_INFO'}) ? "Defined: 
$ENV{'PATH_INFO'}"   :
"Not defined";

and that displays Not Defined. Again, this is Apache V 2.

So it seems your assumption that path_info is always defined, is wrong, at least
in the case of non-mod_perl handlers.


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@xxxxxxxxxxxxxxxxx/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: cgiapp-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: cgiapp-help@xxxxxxxxxxxxxxxxx




<Prev in Thread] Current Thread [Next in Thread>