[recap: trying to simulate repeatable directives like this conf
snippet, in perl--

        <VirtualHost *>
                ...
                PerlSetVar MasonCompRoot /var/www/xyz.pdq
                PerlSetVar MasonDataDir  /var/cache/mason/xyz.pdq
                ...
        </VirtualHost>

and running into "PerlSetVar takes two arguments" error...]

On Thu, Apr 01, 2004 at 11:39:59PM -0500, Geoffrey Young wrote:
> > what's the workaround? didn't see anything like this in our
> > searchings through the mod_perl list archives...
> 
> did you try this:
> 
>   push @PerlSetVar, "MasonCompRoot /var/www/$site";
> 
> ?
> 
> IIRC most of the configurations could accept a simple string in
> mp1, so I would expect things to be pretty much the same in
> mp2.

but this is for a virtualhost, so it hasta be a sub-item within
a <virtualhost> hash, such as

        ...
        push @{$VirtualHost{'*'}}, {
                PerlSetVar => [
                        MasonCompRoot => "/var/www/$dir",
                        MasonDataDir  => "/var/cache/mason/$dir",
                        ...
                ],
                ServerName => $dir,
                DocumentRoot => "$main/$dir",
                ...
        };
        ...

the trouble is, as previously mentioned, that PerlSetVar pukes
when it gets more than two items (yes, even when pushing
arrayrefs instead of individual values); instead of generating
multiple "perlsetvar" statements as we'd hoped, it wants to do
just one such statement with all the args at once,

        PerlSetVar MasonCompRoot /var/www/site MasonDataDir /var/cache/mason/site

which is of course illegal. surely this can be done using
<perl> sections?

> > we also tried "grep -ri 'takes two arguments'
> > /usr/lib/perl5/Apache2" and turned up nothing. where's the
> > error message actually coming from?
> 
> that comes directly from Apache when it reinforces the TAKE2
> prototype

ah. so this looks like a "no can do" type of thing (despite the
docs which say it just shifts off the minimum number of args).
looks like i'll have to 

        Apache->server->add_config()

instead. unless i'm missing something?

===

hmm. just had a thought -- in this case maybe we could conjure
up some perl code to eval, that would contain the whole handler
code that creates the mason object with all the necessary
parameters. hmm!

that could work... but it's a special-case solution to this
situation. is there no <perl> section interface for this type of
thing?

-- 
will trillich
http://www.serensoft.com/
http://www.midwestRepo.com/
http://www.skylineAuto.net/


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to