@INC per virtual host

2000-09-18 Thread HotMail: Bill

Greetings,

Can the perl include path be configured on a per virtual host basis?

-Bill



Re: Clean way of transfering Objects between childinit and requesthandlers ?

2000-09-18 Thread Greg Cope

Matt Sergeant wrote:
 
 On Sun, 17 Sep 2000, Chris Winters wrote:
 
  Hi Greg,
 
  Check out Class::Singleton for this purpose. Works great for me.
 

.
snippage
 
 One thing C::Singleton misses is a clear_instance method though, which is
 pretty much necessary for mod_perl work (I'm surprised Andy hasn't fixed
 this, since he does a lot of mod_perl stuff)...
 
 However copying the code is pretty trivial and adding that method is about
 another 3 lines.

Thanks gents - I'd not seen this one before.

Oh, Chris I think your ratio is a bit low - the actual module code is
extremely short.

Greg


 
 --
 Matt/
 
 Fastnet Software Ltd. High Performance Web Specialists
 Providing mod_perl, XML, Sybase and Oracle solutions
 Email for training and consultancy availability.
 http://sergeant.org | AxKit: http://axkit.org




Re: I'm missing something in Apache::Cookie

2000-09-18 Thread darren chamberlain

Michael ([EMAIL PROTECTED]) said something to this effect:
 H.
 
 When I retrieve a cookie
 
 %cookies = Apache::Cookie-fetch;
 
 I get a hash that contains the name of the cookie as the key and a 
 scalar reference as the value. 
 Apache::Cookie=SCALAR(0xblah...)
 Can't seem to unravel it to get at the 
 value. Using
 
 %xx = Apache::Cookie-parse($val);
 gives an apparently empty hash, yet retrieving the headers via 
 Apache::Table yields the correct results
 
 Cookie=foo=bar
 
 cook name val
foo  bar
 
 
 So what am I doing wrong with Apache::Cookie that keeps me from 
 returning the cookie value.

This should do it:

my $ac  = Apache::Cookie-new($r);
my $cookies = $ac-fetch;
my %cookies = ();
for (keys %{$cookies}) {
$cookies{$_} = $cookies-{$_}-value;
}

However, I always find it easier to fetch cookies like this:

my $cookies = { map  { $1 = $2 if (/([^=]+)=(.*)/) }
grep !/^$/, split /;\s*/, $r-header_in('cookie') };
$r-pnotes('cookies', $cookies);

No messing with objects or any of that stuff. Putting it into pnotes makes
the hashref accessible to other phases or subroutines easily (you only have
to pass $r). (That's why I use a hashref and not a hash, so I can just put
it directly into pnotes.)

(darren)

-- 
If you wish to drown, do not torture yourself with shallow water.