sub handler {
my $r = shift; my $uri = $r->uri; ... detecting dynamic handlers ... while( my($url, $dirs) = each %STATIC_FILES ) { if( $uri =~ m{$url/(.*)$} ) { foreach my $d (@$dirs) { my $file = "$d/$1"; if( -f $file ) { $r->filename($file); return OK; } } } } }
ah, a real-world example. Just what we need. Care to write a short pod section using this example, explaining the problem and the solution? plain text or pod will do. we will add it to the coding chapter.
Hmm, let's use my english-like language...
The problem: - the application static files are installed in /myapp/img, /myapp/css, ... - local site customization can be made by installing customized files in /custom/img, /custom/css... - in both cases they are accessed via /img/..., /css/... urls
The solution - we use custom transhandler to check whether the customized version exists and use it if so.
Yes, but can you write a section to be added to the documentation, explaining the problem, providing an example and a solution. Something that you'd have loved to find in the docs, when you first discovered it? Of course digesting all the helpful comments from others in this thread.
Good docs don't grow on the trees, someone has to put them together.
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com