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.277.549 Times

Data::Diver 1.0101

  Date Added: April 23, 2010  |  Visits: 819

Data::Diver

Report Broken Link
Printer Friendly Version


Product Homepage
Download (87 downloads)



Data::Diver is a simple, ad-hoc access to elements of deeply nested structures. SUMMARY Data::Diver provides the Dive() and DiveVal() functions for ad-hoc access to elements of deeply nested data structures, and the DiveRef(), DiveError(), DiveClear(), and DiveDie() support functions. SYNOPSIS use Data::Diver qw( Dive DiveRef DiveError ); my $root= { top => [ { first => 1 }, { second => { key => [ 0, 1, 2, { three => { exists => yes, }, }, ], }, }, ], }; # Sets $value to yes # ( $root->{top}[1]{second}{key}[3]{three}{exists} ): my $value= Dive( $root, qw( top 1 second key 3 three exists ) ); # Sets $value to undef() because "missing" doesnt exist: $value= Dive( $root, qw( top 1 second key 3 three missing ) ); # Sets $value to undef() because # $root->{top}[1]{second}{key}[4] is off the end of the array: $value= Dive( $root, qw( top 1 second key 4 ... ) ); # Sets $value to undef() because # $root->{top}[1]{second}{key}[-5] would be a fatal error: $value= Dive( $root, qw( top 1 second key -5 ... ) ); # Sets $ref to $root->{top}[9]{new}{sub} (which grows # @{ $root->{top} } and autovifies two anonymous hashes): my $ref= DiveRef( $root, qw( top 9 new sub ) ); # die()s because "other" isnt a valid number: $ref= DiveRef( $root, qw( top other ... ) ); # Does: $root->{num}{1}{2}= 3; # (Autovivifies hashes despite the numeric keys.) DiveVal( $root, ( qw( num 1 2 ) ) ) = 3; # Same thing: ${ DiveRef( $root, num, 1, 2 ) } = 3; # Retrieves above value, $value= 3: $value= DiveVal( $root, num, 1, 2 ); # Same thing: $value= ${ DiveRef( $root, ( qw( num 1 2 ) ) ) }; # Tries to do $root->{top}{1} and dies # because $root->{top} is an array reference: DiveRef( $root, top, 1 ); # To only autovivify at the last step: $ref= DiveRef( Dive( $root, qw( top 1 second key 3 three ) ), missing ); if( $ref ) { $$ref= me too } else { my( $nestedRef, $svKey, $errDesc )= DiveError(); die "Couldnt dereference $nestedRef via $$svKey: $errDescn"; }.

Requirements: No special requirements
Platforms: Linux
Keyword: Datadiver Diveerror Diveref Diveval Libraries Programming Qw Root Second Top Value
Users rating: 0/10

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


DATA::DIVER RELATED
Libraries  -  XML::Bare 0.11
XML::Bare is a minimal XML parser implemented via a C state engine. SYNOPSIS use XML::Bare; my $xml = new XML::Bare( text => Bob ); # Parse the xml into a hash tree my $root = $xml->parse(); # Print the content of the...
10.24 KB  
Libraries  -  Regexp::Parser::Handlers 0.20
Regexp::Parser::Handlers is a Perl module with handlers for Perl 5 regexes. This module holds the init() method for the Regexp::Parser class, which installs all the handlers for standard Perl 5 regexes. This documentation contains a sub-classing...
40.96 KB  
Libraries  -  SOAP::Data 0.69
SOAP::Data is a Perl class that provides the means by which to explicitly manipulate and control all aspects of the way in which Perl data gets expressed as SOAP data entities. The SOAP::Data class provides the means by which to explicitly...
235.52 KB  
Programming  -  DL/SQL 1.0.1
DL/SQL is declarative, turing-complete programming language based on top of SQL database. The main idea is to store both program and data in one SQL table and make all the computations in it. The current version of interpreter written in PHP...
21.5 KB  
Libraries  -  Pogo 0.10
Pogo is a Perl interface for GOODS. SYNOPSIS use Pogo; $pogo = new Pogo sample.cfg; # connect to a database $root = $pogo->root_tie; # get a reference to root hash in the database $root->{key1} = "string"; # store a string into the...
12.29 KB  
Programming  -  Sh 0.8.0 RC1
Sh is a programming language built on top of C++. It can be used to write shaders that run on top of modern graphics processing units (GPUs), or write stream programs that run on GPUs or CPUs. Sh project is implemented as a C++ library, and...
378.88 KB  
Desktop Utilities  -  JD4X 0.6
JD4X project is a basic GUI Windowing Environment developed to support the Java Programming Language based on top of the X Window system. It was developed with the intention of providing a Java environment that allows Java programmers to build and...
17 MB  
Libraries  -  Bio::Root::Object 1.4
Bio::Root::Object is a core Perl 5 object. SYNOPSIS # Use this module as the root of your inheritance tree. Object Creation require Bio::Root::Object; $dad = new Bio::Root::Object(); $son = new Bio::Root::Object(-name => Junior, -parent...
4.7 MB  
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  
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