Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.235.631 Times

Tie::ListKeyedHash 1.02

  Date Added: June 06, 2010  |  Visits: 852

Tie::ListKeyedHash

Report Broken Link
Printer Friendly Version


Product Homepage
Download (98 downloads)



Tie::ListKeyedHash is a system allowing the use of anonymous arrays as keys to a hash. SYNOPSIS use Tie::ListKeyedHash; [$X =] tie %hash, Tie::ListKeyedHash; my $live_key = [key,items,live]; $hash{$live_key} = Hello!; $hash{[key,trees,grow]} = Goodbye!; print $hash{[key,items,live]},"n"; delete $hash{$live_key}; my @list = keys %{$hash{[key]}}; print "@listn"; untie %hash ; Alternatively keys are accessible as: $hash{key,items,live} = Hello!; (a bare list/array for the key rather than using an anon list/array reference). But that slows down the accesses by around 10% and cannot be used for keys that conflict with the value of the $; special variable. Also usable via the object interface methods put, get,exists,delete,clear. The object interface is about 2x as fast as the tied interface. Tie::ListKeyedHash ties a hash so that you can use a reference to an array as the key of the hash. It otherwise behaves exactly like a normal hash (including all caveats about trying to use a key as both a hash reference and a scalar value). This frees you from needing to hardwire hash references in code or having to write tree traversal code to reach arbitrary points in a hash tree. Example: ######################## #!/usr/bin/perl use strict; use warnings; use Data::Dumper; use Tie::ListKeyedHash; my %example; tie (%example, Tie::ListKeyedHash); %example = ( a => { b0 => { c => value of c, d => value of d, e => { f => value of f, }, }, b1 => { g => value of g, }, }, h => r, ); my $b_key = [a,b0]; my $d_key = [@$b_key,d]; my $d = $example{$d_key}; print "d = $dn"; my $e_key = [@$b_key, e]; my $e = $example{$e_key}; print e = . Dumper ($e); my $f_key = [@$b_key, e,f]; my $f = $example{$f_key}; print "f = $fn"; my $h_key = [h]; my $h = $example{$h_key}; print "h = $hn"; ######################## The virtues of this particular way of accessing hash-of-hashes (HoH) vs bare hardwired derefererences or tree crawling are as follows: 1) As the number of levels in a HoH increases, the tied object asymptotically approaches the speed of hardwired hash dereferencing without the loss of flexibility penalty of having to hardwire the keys into code in advance. This gives an important property that it gets faster the deeper a HoH becomes as compared with the speed of software driven tree traveral. So you can build and access arbitrarily structured HoH and still access deeply buried elements in the tree quickly. 2) The format was designed to use memory efficiently. It takes only a few hundred extra bytes over the size of an untied HoH in memory or when serialized (via Data::Dumper or Storable for example) regardless of how deep the hash is. 3) A reference to an existing HoH can be passed into Tie::ListKeyedHash->new and all of the OO key lists access methods will "just work". Example: use Tie::ListKeyedHash; my %hash = ( a => { b => c } ); my $obj = Tie::ListKeyedHash->new(%hash); my $b_value = $obj->get([a,b]);. A freeware integrated WWW and FTP log reporting tool that include support for standard and combined access_log formats and generation of graphical reports. Written in perl.

Requirements: No special requirements
Platforms: Linux
Keyword: Example Hash Hoh Key Keys Libraries Listkeyedhash Programming Tielistkeyedhash Use Of Value Value Of
Users rating: 0/10

License: Freeware Size: 16.38 KB
USER REVIEWS
More Reviews or Write Review


TIE::LISTKEYEDHASH RELATED
Libraries  -  G15Daemon 1.9.0 pre 2.0
G15daemon takes control of the Logitech G15 keyboard, allowing the use of all keys through the Linux kernel input device driver. It also controls the use of the keyboards LCD display, allows multiple client applications to connect, and gives the...
276.48 KB  
Multimedia & Graphics  -  Gnome Multimedia Keys 0.2
Gnome Multimedia Keys is an Amarok script that will allow the use of keyboard multimedia keys in Gnome 2.18 and above (eg. ubuntu feisty) to control playback. This includes most multimedia buttons found on many laptops. Support for this was broken...
2.05 KB  
Libraries  -  Tie::Hash::RegexKeys 1.2
Tie::Hash::RegexKeys will match hash keys using Regular Expressions. SYNOPSIS use Tie::Hash::RegexKeys; use Data::Dumper; my %h; tie %h, Tie::Hash::RegexKeys; my $a = .1.2.3.4.5.6.2; my $b = .1.2.3.4.5.7; my $c = .1.2.3.4.5.6.1; my...
3.07 KB  
Libraries  -  strhash 0.6.0
strhash is a hash table library. A strhash is an associative array, mapping keys to values. Keys and values may be strings of up to 2 gigabytes (2^31) bytes of length, containing any possibly character. Keys need not be unique. All hashing...
32.77 KB  
Libraries  -  DAEMon Raco Libraries 0.3
DAEMon Raco Libraries (DRLibs) is a collection of useful functions, objects, and routines for C++. Whats New in This Release: - This release adds new libraries to manage object lists: doublelist.dr.h, simplelist.dr.h, and sortedlist.dr.h..
28.67 KB  
Libraries  -  Adobe Source Libraries 1.0.29
The Adobe Source Libraries (ASL) are a collection of C++ libraries building foundation technology to allow the construction of commercial applications by assembling generic algorithms through declarative descriptions. Whats New in This Release:...
8.2 MB  
Libraries  -  PoJoe Component Libraries 1.1
PoJoe Component Libraries project is a set of Java POJO components, originally developed for OSMQ. Developers have found these components useful in building robust enterprise applications. Of note are: a FIFO queue that utilizes memory until a...
890.88 KB  
Libraries  -  Crypt::UnixCrypt 1.0
Crypt::UnixCrypt is a perl-only implementation of the crypt function. SYNOPSIS use Crypt::UnixCrypt; $hashed = crypt($plaintext,$salt); # always use this modules crypt BEGIN { $Crypt::UnixCrpyt::OVERRIDE_BUILTIN = 1 } use...
8.19 KB  
Security Tools  -  Hash Codes 1.62.780.7200
Hash Codes is a simple and easy to use application designed to enable users to hash data from keyboard, file or CD/DVD. This tool supports: Adler32, CRC32, CRC64, MD2, MD4, MD5, MD6, SHA-0, SHA-1, SHA-1-IME, SHA-224, SHA-256, SHA-384, SHA-512,...
 
Security Tools  -  Hash Codes x64 1.62.780.7200
Hash Codes is a simple and easy to use application designed to enable users to hash data from keyboard, file or CD/DVD. This tool supports: Adler32, CRC32, CRC64, MD2, MD4, MD5, MD6, SHA-0, SHA-1, SHA-1-IME, SHA-224, SHA-256, SHA-384, SHA-512,...
430 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB