Scott Penrose wrote: > Now it seems obvious, but I can't find a reference to get the real > directory of a URI. > Examples I have found on CPAN look something like this... > > my $uri = $r->uri; > $uri =~ s|[^/]+$||; > my $dir = $r->document_root . $uri; > > The problem with the above is that it does not take into account Alias > which could put the URI outside the document_root.
you need to parse $r->filename. File::Spec and the other File:: tools on CPAN are your friend. HTH --Geoff