perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin.Rus...@wdr.com
Subject RE: Re: Use of mod_rewrite on Perl sections
Date Wed, 01 Mar 2000 10:24:22 GMT
I am pleased to say that, having written a Tie:DxHash module 
(allowing duplicate keys and preserving insertion order), the problem 
was solved.  Thanks to all who offered advice.  Once I have cleaned 
up, documented and packaged the module, I will submit it to CPAN.

-----Original Message-----
From: ged 
Sent: 29 February 2000 12:59
To: modperl
Cc: ged
Subject: FW: RE: Re: Use of mod_rewrite on Perl sections


Hi there,

On Tue, 29 Feb 2000 Kevin.Ruscoe@wdr.com wrote:

> I believe 
> I need a hash which both preserves insertion order and allows 
> duplicate keys.
[snip]
> So, unless anyone knows of such a module (or thinks I have the wrong
> end of the stick altogether :) I will roll my own Tie::DuplicateHash

Maybe you need a Tie::BTREEHash?  (I just invented it, but I've been
thinking about it for a while.)

The thinking behind it is this: I have been using a small, fast, solid
BTREE/ISAM package (from SoftFocus, Canada) for about 15 years.  To my
way of thinking it's the way to go if you want keyed access to, say,
between 20,000 records (my customer file) and half a million records
(my invoice file) where a flat file solution is starting to groan but
you don't want the overhead of a full-blown database.

It should be relatively easy to harness it, I have a harness I wrote
when SoftFocus changed all the calling conventions and broke all my
code (grr...).  It's all written in C BTW.

Now I'm sure that somebody on the list is going to tell me that it's
already been done (they usually do that when I have an idea:) which is
why I'm posting this.

73,
Ged.

> Just to recap, I believe I need something along the following lines 
> to work:
> 
> use Tie::DuplicateHash;
> tie %virtual_host, Tie::DuplicateHash;
> %virtual_host =
> (
>  ServerName => 'fred',
>  ...
>  RewriteCond => 'foo1',
>  RewriteRule => 'bar1',
>  RewriteCond => 'foo2',
>  RewriteRule => 'bar2',
> );
> push $VirtualHost{'1.2.3.4'}, \%virtual_host;
> 
> Cheers
> 
> Kevin
> 
> -----Original Message-----
> From: sbekman 
> Sent: 25 February 2000 20:29
> To: modperl
> Cc: sbekman
> Subject: FW: RE: Re: Use of mod_rewrite on Perl sections
> 
> 
> > >Thanks.  I have read Ralf's mod_rewrite guide.  This is more of 
a 
> > >Perl Sections question.  A couple of people have said "Just use 
> > >$PerlConfig", which is understandable.  However, in my 
particular 
> > >conf, the resulting code would look much nicer if I could use 
full 
> > >Perl configuration syntax.  I have a feeling that, as of the 
> latest 
> > >release of modperl, this is not possible.  It would be nice if 
> > >someone could confirm this, though.
> > 
> > In theory you should be able to make it work using Tie::IxHash,
> > I didn't make it work but it is most probably my fault and as
> > I'm lazy and impatient I went the @PerlConfig way.
> 
> Tie::IxHash isn't a core module (yet), therefore make sure you add 
it 
> to
> the CPAN's Bundle::Apache, since most chances that this module 
won't 
> be
> available on the machine of users:
> cpan> i /Bundle::Apache/
> 
> Bundle          Bundle::Apache  (DOUGM/mod_perl-1.21.tar.gz)



This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.


Mime
View raw message