Path: usenet.cise.ufl.edu!newsfeeds.nerdc.ufl.edu!news.magicnet.net!feed1.news.rcn.net!rcn!newsfeed.cwix.com!192.26.210.166!sunqbc.risq.qc.ca!newsfeed.corridex.com!nntp2.savvis.net!inetarena.com!not-for-mail
From: Russ Allbery <
[email protected]>
Newsgroups: comp.lang.perl.announce,comp.lang.perl.modules
Subject: ANNOUNCE: Tie::ShadowHash 0.3 now available
Followup-To: comp.lang.perl.modules
Date: 31 Mar 1999 13:24:18 GMT
Organization: The Eyrie
Lines: 41
Approved:
[email protected] (comp.lang.perl.announce)
Message-ID: <
[email protected]>
NNTP-Posting-Host: halfdome.holdit.com
X-Disclaimer: The "Approved" header verifies header information for article transmission and does not imply approval of content.
Xref: usenet.cise.ufl.edu comp.lang.perl.announce:278 comp.lang.perl.modules:9916
I've just uploaded a new Perl module, Tie::ShadowHash, to PAUSE. It
should be showing up on CPAN shortly, or you can download it directly from
<URL:
ftp://ftp.eyrie.org/pub/software/modules/ShadowHash-0.03.tar.gz>.
Summary, taken from the README:
If you have a bunch of separate sources of data in the form of Perl
hashes, tied hashes (of whatever type, including on-disk databases tied
with DB_File, GDBM_File, or similar modules), or text files that you
want to turn into hashes, and you want to be able to query all of those
sources of data at once for a particular key without having to check
each one of them individually each time, this module is what you're
looking for. If you want to use a hash-like data source, even just one,
but make modifications to its data over the course of your program that
override its contents while your program runs but which don't have any
permanent effect on it, then this module may be what you're looking for.
Tie::ShadowHash lets you create a "shadow hash" that looks like a
regular Perl hash to your program but behind the scenes queries a whole
list of data sources. All the data sources underneath have to also
behave like Perl hashes, but that's the only constraint. They can be
regular Perl hashes or other tied hashes, including tied DB_File or
GDBM_File hashes or the like to access on-disk databases. All data
sources are treated as read-only; modifications to any data is stored in
the shadow hash itself, and subsequent accesses reflect any
modifications, but none of the data sources are changed.
See the POD documentation for complete details, features, and usage.
This is another side product of my work on News::Gateway that seemed
generally useful. It's only a couple of day's worth of coding effort so
far, and is quite simple, but I didn't see anything like it already on
CPAN.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print