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

2ND TRY: Q: How to access Apache Request ($r) from Apache::ASP??

Expand Messages
  • Brat Wizard
    Q: How to access Apache Request ($r) from Apache::ASP?? Since I don t seem to be lighting a lot of lightbulbs with this question, let me try a different
    Message 1 of 3 , Aug 10, 2002
      Q: How to access Apache Request ($r) from Apache::ASP??

      Since I don't seem to be lighting a lot of lightbulbs with this question, let
      me try a different tack...

      I need to be able to set a "PerlSetVar" variable (in the Apache httpd.conf)
      for a virtual server and read it from Apache::ASP. Is there a way to do this?

      Thanks

      John

      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • Ellers
      ... Is there such a thing? I thought it was called $Request, as per: http://www.apache-asp.org/objects.html Maybe I missed $r... ... hmm ... How is this
      Message 2 of 3 , Aug 11, 2002
        >
        > Q: How to access Apache Request ($r) from Apache::ASP??
        >

        Is there such a thing? I thought it was called $Request, as per:

        http://www.apache-asp.org/objects.html

        Maybe I missed $r...


        > Since I don't seem to be lighting a lot of lightbulbs with this question, l
        > et
        > me try a different tack...

        hmm

        >
        > I need to be able to set a PerlSetVar variable (in the Apache httpd.conf)
        >
        > for a virtual server and read it from Apache::ASP. Is there a way to do thi
        > s?

        How is this related to the previous question?

        The following is an excerpt from one of the httpd.conf's I've used:


        <Files ~ (\.asp)>
        SetHandler perl-script
        PerlHandler Apache::ASP

        # The default session serializer has limitations on size.
        # This version does not have that limitation.
        PerlSetVar StateDB MLDBM::Sync::SDBM_File

        # By using Data::Dumper the session is saved in (partially) english.
        # Using Storable would be faster and smaller, but in binary. Not
        # suitable, at least for development.
        PerlSetVar StateSerializer Data::Dumper

        # definitely want Perl to use strict scoping etc
        PerlSetVar UseStrict 1
        </Files>


        hope it lights some lightbulbs for ya

        Ellers


        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      • Brat Wizard
        Hello there- In the event that there are other dimwits (like me) lurking on this list, I thought I d share what I learned... The Apache- request structure is
        Message 3 of 3 , Aug 11, 2002
          Hello there-

          In the event that there are other dimwits (like me) lurking on this list, I
          thought I'd share what I learned...

          The Apache->request structure is but a simple call away-- it lies just under
          the surface of the Apache::ASP code and can be easily constructed with the
          following syntax:

          my $r = Apache->request;

          Then the $r variable may be used in the manner described in the "Writing
          Apache Modules in Perl & C". (Apache Handlers in Perl)

          This allows you to set a variable in the Apache httpd.conf file like so:

          <some_container blah..blah>
          PerlSetVar foo bar
          </some_container>

          Then in your Apache::ASP code you can access it thusly:

          my $r = Apache->request;
          my $foo = $r->dir_config('foo');
          print "foo = $foo";

          Thanks to Ellers for giving me the clue that allowed me to unravel the answer.

          Regards,

          John


          On Friday 09 August 2002 10:50 am, Brat Wizard spewed into the ether:
          > Q: How to access Apache Request ($r) from Apache::ASP??
          >
          > Thanks
          >
          > John
          >
          > ---------------------------------------------------------------------
          > To unsubscribe, e-mail: asp-unsubscribe@...
          > For additional commands, e-mail: asp-help@...


          ---------------------------------------------------------------------
          To unsubscribe, e-mail: asp-unsubscribe@...
          For additional commands, e-mail: asp-help@...
        Your message has been successfully submitted and would be delivered to recipients shortly.