Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robrwo/tie-rangehash
Perl hashes with ranges of values as keys
https://github.com/robrwo/tie-rangehash
Last synced: 11 days ago
JSON representation
Perl hashes with ranges of values as keys
- Host: GitHub
- URL: https://github.com/robrwo/tie-rangehash
- Owner: robrwo
- Created: 2011-06-19T20:38:54.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-06-19T20:39:15.000Z (over 13 years ago)
- Last Synced: 2024-10-11T21:56:34.398Z (about 1 month ago)
- Language: Perl
- Homepage:
- Size: 97.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- Changelog: Changes
Awesome Lists containing this project
README
NAME
Tie::RangeHash - Allows hashes to associate values with a range of keysREQUIREMENTS
Perl 5.6.1 is required.Algorithm::SkipList is required. Otherwise it uses standard modules.
Installation
Installation can be done using the traditional Makefile.PL or the
newer Build.PL methods.Using Makefile.PL:
perl Makefile.PL
make
make test
make install(On Windows platforms you should use nmake instead.)
Using Build.PL (if you have Module::Build installed):
perl Build.PL
perl Build
perl Build test
perl Build installSYNOPSIS
use Tie::RangeHash;tie %hash, 'Tie::RangeHash';
$hash{'A,C'} = 1;
$hash{'D,F'} = 2;
$hash{'G,K'} = 3;$hash{'E'}; # returns '2'
$hash{'BB'}; # returns '1'$hash{'KL'}; # returns nothing ('undef')
There is also an object-oriented interface:
$hash = new Tie::RangeHash;
$hash->add('A,C', 1);
$hash->add('G,I', 2);$hash->fetch('H'); # returns '2'
DESCRIPTION
This module allows hashes to associate a value with a *range* of keys
rather than a single key.A more detailed description can be found in the module's POD docu-
mentation.REVISION HISTORY
Changes since Tie::RangeHash 1.021.05 Fri Mar 26 1010
- re-uploaded version accidentally deleted from CPAN1.04 Fri Jan 4 2008
- re-uploaded version accidentally deleted from CPAN
- minor changes to Build.PL1.03 Wed Jan 4 2005
- added fetch_range to fetch overlapping rangesA detailed revision history is in the Changes file included with
this distribution.KNOWN ISSUES
The is a new version of the module and has behaves differently compared
to older versions. This is due to using the List::SkipList module for
maintaining the underlying data rather than re-implementing it. While
this improves the maintainability with the code, it increases incom-
patability with previous versions.See the the Changes file for a more complete list of changes and
incompatabilities.SEE ALSO
A module with similar functionality for numerical values is
Array::IntSpan.Algorithm::SkipList for more information on skip lists.
AUTHOR
Robert RothenbergLICENSE
Copyright (C) 2000-2005 Robert Rothenberg. All rights reserved. This
program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.