Loading ...
Sorry, an error occurred while loading the content.

Re: MP2: trouble in PerlSection: how to do multiple "PerlSetVar"?

Expand Messages
  • Geoffrey Young
    ... 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
    Message 1 of 7 , Apr 1, 2004
    • 0 Attachment
      > 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.

      >
      > 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

      HTH

      --Geof

      --
      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
    • Will Trillich
      [recap: trying to simulate repeatable directives like this conf snippet, in perl-- ... PerlSetVar MasonCompRoot /var/www/xyz.pdq PerlSetVar
      Message 2 of 7 , Apr 4, 2004
      • 0 Attachment
        [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
      • Geoffrey Young
        ... it was the full string that you ought to try: push @{$VirtualHost{ * }}, { PerlSetVar = MasonCompRoot /var/www/$dir , ... if all else fails that s always
        Message 3 of 7 , Apr 5, 2004
        • 0 Attachment
          >>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",
          > ...
          > };
          > ...

          it was the full string that you ought to try:

          push @{$VirtualHost{'*'}}, {
          PerlSetVar => "MasonCompRoot /var/www/$dir",


          > 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()

          if all else fails that's always available, yes.

          --Geoff

          --
          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
        • Will Trillich
          ... ah so. we hadn t tried that -- we had done the string within subarrays like this = so as a workaround, in theory, we could do this: = = PerlSetVar =
          Message 4 of 7 , Apr 5, 2004
          • 0 Attachment
            On Mon, Apr 05, 2004 at 08:15:40AM -0400, Geoffrey Young wrote:
            > >>did you try this:
            > >>
            > >> push @PerlSetVar, "MasonCompRoot /var/www/$site";
            > >>
            > >>?
            >
            > it was the full string that you ought to try:
            >
            > push @{$VirtualHost{'*'}}, {
            > PerlSetVar => "MasonCompRoot /var/www/$dir",

            ah so. we hadn't tried that -- we had done the "string within
            subarrays" like this

            = so as a workaround, in theory, we could do this:
            =
            = PerlSetVar => [
            = ["MasonCompRoot /var/www/$site",],
            = ["MasonDataDir /var/cache/mason/$site",],
            = ["MasonAutoHandlerName $autohandlername",],
            = ["MasonDHandlerName $dhandlername",],
            = ["MasonDeclineDirs 0",],
            = ],

            but now, trying it without the subarrays,

            PerlSetVar => [
            "MasonCompRoot /var/www/$site",
            "MasonDataDir /var/cache/mason/$site",
            "MasonAutoHandlerName $autohandlername",
            "MasonDHandlerName $dhandlername",
            "MasonDeclineDirs 0",
            ],

            we STILL get "two args only, please, move along." pooh.
            does it work for you?

            --
            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
          • HLiu@ap.org
            Try use Data::Dumper; to debug it. Willy ... ah so. we hadn t tried that -- we had done the string within subarrays like this = so as a workaround, in
            Message 5 of 7 , Apr 5, 2004
            • 0 Attachment
              Try "use Data::Dumper; " to debug it.

              Willy



              |---------+---------------------------->
              | | Will Trillich |
              | | <will@serensoft.c|
              | | om> |
              | | Sent by: Will |
              | | Trillich |
              | | <will@midwestRepo|
              | | .com> |
              | | |
              | | |
              | | 04/05/2004 11:31 |
              | | AM |
              | | |
              |---------+---------------------------->
              >--------------------------------------------------------------------------------------------------------------|
              | |
              | To: modperl@... |
              | cc: |
              | Subject: Re: MP2: trouble in PerlSection: how to do multiple "PerlSetVar"? |
              >--------------------------------------------------------------------------------------------------------------|




              On Mon, Apr 05, 2004 at 08:15:40AM -0400, Geoffrey Young wrote:
              > >>did you try this:
              > >>
              > >> push @PerlSetVar, "MasonCompRoot /var/www/$site";
              > >>
              > >>?
              >
              > it was the full string that you ought to try:
              >
              > push @{$VirtualHost{'*'}}, {
              > PerlSetVar => "MasonCompRoot /var/www/$dir",

              ah so. we hadn't tried that -- we had done the "string within
              subarrays" like this

              = so as a workaround, in theory, we could do this:
              =
              = PerlSetVar => [
              = ["MasonCompRoot /var/www/$site",],
              = ["MasonDataDir /var/cache/mason/$site",],
              = ["MasonAutoHandlerName $autohandlername",],
              = ["MasonDHandlerName $dhandlername",],
              = ["MasonDeclineDirs 0",],
              = ],

              but now, trying it without the subarrays,

              PerlSetVar => [
              "MasonCompRoot /var/www/$site",
              "MasonDataDir /var/cache/mason/$site",
              "MasonAutoHandlerName $autohandlername",
              "MasonDHandlerName $dhandlername",
              "MasonDeclineDirs 0",
              ],

              we STILL get "two args only, please, move along." pooh.
              does it work for you?

              --
              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






              --
              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
            • Will Trillich
              ... we do. :( it shows that our structures look the way we expect them to look -- the problem is that they re obviously not the way APACHE expects them to
              Message 6 of 7 , Apr 5, 2004
              • 0 Attachment
                On Mon, Apr 05, 2004 at 11:39:16AM -0400, HLiu@... wrote:
                > Try "use Data::Dumper; " to debug it.

                we do. :( it shows that our structures look the way we expect
                them to look -- the problem is that they're obviously not the
                way APACHE expects them to look...

                see new thread Subject: <perl> sections: "*:80 has no VirtualHosts" error




                > |---------+---------------------------->
                > | | Will Trillich |
                > | | <will@serensoft.c|
                > | | om> |
                > | | Sent by: Will |
                > | | Trillich |
                > | | <will@midwestRepo|
                > | | .com> |
                > | | |
                > | | |
                > | | 04/05/2004 11:31 |
                > | | AM |
                > | | |
                > |---------+---------------------------->

                wow. creative bandwidth sink you've got there. (just say no.)

                --
                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
              Your message has been successfully submitted and would be delivered to recipients shortly.