You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Nikolaus Rath <Ni...@rath.org> on 2001/03/09 16:00:00 UTC

Passing Objects with PerlSetVar

Hello!

<Location Bla>
   <Perl>
         my $o = { "bar" => 1,
                   "foo" => "com",
                   "other" => 0 };
         push @PerlSetVar, "Objekt, $o;
   </Perl>
   PerlHandler Bla   
</Location>

And inside the Bla Handler:

my $o = $r->dir_config("Objekt");

Is $o now still a complex object, so i could do $o->{"bar"}, or is it
just a "normal" scalar value (like HAS283752)?

  - Nikolaus

-- 
> Bekomme ich das mit einer wilden Kombination aus find, sed, cp und
> xargs hin oder sollte ich besser ein Perlskript schreiben?
Verwende Perl. Shell will man koennen, dann aber nicht verwenden."
                                 - Marc Haber u. Kristian Köhntopp, dcoum


Re: Passing Objects with PerlSetVar

Posted by darren chamberlain <dl...@users.sourceforge.net>.
Ken Williams (ken@forum.swarthmore.edu) said something to this effect on 03/12/2001:
> dlc@users.sourceforge.net (darren chamberlain) wrote:
> >I just found Apache::Storage <URL:http://tangent.org/Apache-Storage/>,
> >which will let you store complex data structures from httpd.conf:
> I wonder why I've never heard of this module before.  It looks like it's
> never been discussed on the list, and it's not in the module list.

It's not on CPAN, as far as I know; I came across it on
Freshmeat (<URL:http://freshmeat.net/projects/apachestorage/>).
The Freshmeat main branch is dated Feb 17, so it's pretty new.

It's the same guy who maintains mod_layout, if that means
anything to anyone.

(darren)

-- 
A sect or party in an elegant incognito devised to save a man from the
vexation of thinking.
    -- Ralph Waldo Emerson

Re: Passing Objects with PerlSetVar

Posted by Ken Williams <ke...@forum.swarthmore.edu>.
dlc@users.sourceforge.net (darren chamberlain) wrote:
>I just found Apache::Storage <URL:http://tangent.org/Apache-Storage/>,
>which will let you store complex data structures from httpd.conf:
>
># httpd.conf
>ApacheStore o { "bar" => 1, "foo" => "com", "other" => 0 }
>
>In your handler, do:
>
>use Apache::Storage;
>sub handler {
>    my $r = shift;
>    my $o = get_storage('o');
>
>    ...
>
>And so on.


I wonder why I've never heard of this module before.  It looks like it's
never been discussed on the list, and it's not in the module list.


  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  ken@forum.swarthmore.edu                            The Math Forum

Re: Passing Objects with PerlSetVar

Posted by darren chamberlain <dl...@users.sourceforge.net>.
Nikolaus Rath (Nikolaus@rath.org) said something to this effect on 03/09/2001:
> <Location Bla>
>    <Perl>
>          my $o = { "bar" => 1,
>                    "foo" => "com",
>                    "other" => 0 };
>          push @PerlSetVar, "Objekt, $o;
>    </Perl>
>    PerlHandler Bla   
> </Location>
> 
> And inside the Bla Handler:
> 
> my $o = $r->dir_config("Objekt");
> 
> Is $o now still a complex object, so i could do $o->{"bar"}, or is it
> just a "normal" scalar value (like HAS283752)?

I just found Apache::Storage <URL:http://tangent.org/Apache-Storage/>,
which will let you store complex data structures from httpd.conf:

# httpd.conf
ApacheStore o { "bar" => 1, "foo" => "com", "other" => 0 }

In your handler, do:

use Apache::Storage;
sub handler {
    my $r = shift;
    my $o = get_storage('o');

    ...

And so on.

(darren)

-- 
I decided to stop worrying about my teenage daughter's driving  and take
advantage of it.  I got one of those bumper stickers that say "How's my
driving?" and put a 900 number on it.  At 50 cents a call, I've been
making $38 a week.