Ouch! about 30 seconds after sending my e-mail I had another read of the
mod_perl guide and came across an answer to my problem. I feel stupid for
missing this. Anyway, the following code works for what I want to do:
# Silently redirect text-only requests
my $uri = $r->parsed_uri;
if ($uri->path =~ /^\/text(\/.*)$/) {
$uri->path($1);
$r->subprocess_env('view' => 'text');
$r->internal_redirect($uri->unparse);
return OK;
} else {
$view = $ENV{'REDIRECT_view'};
}
My previous error was to not realise that my environment variable was
renamed from view to REDIRECT_view by the redirect.
--
Jose Marques