I'm not sure exactly of the problem you're having, but I know that in my experience I don't really like using path_info. The path_info is what's left over after the URL->filename translation done by the transhandler (you could, by the way, probably implement your own transhandler to solve some of these issues).

Anyway, the translation gets rather confused when you have URLs that you want handled by your custom handler, but when pieces of the URL exist in the filesystem. I don't know if this is what's happening in your case, but it's certainly possible.

The solution? For me, I've just switched over to using the uri method of the request object:

my $uri = $r->uri;
From that you can determine which file was requested. The other issue is when your handler root isn't the document root. For example, if you configured your Apache like this:
<Location /bar> PerlHandler MyHandler </Location>
Depending on whether "/bar" is part of the filepath you wish to handle, you may need to strip it out, or not. Make sense?

In short: try using uri instead of path_info. And if you start writing a more complex application, look into using a custom PerlTransHandler to do the URL->filename translation.


In reply to Re: Apache/mod_perl woes... by btrott
in thread Apache/mod_perl woes... by PsychoSpunk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.