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

PApp::Storable 1.2

  Date Added: June 07, 2010  |  Visits: 563

PApp::Storable

Report Broken Link
Printer Friendly Version


Product Homepage
Download (88 downloads)



Storable module is a persistence for Perl data structures. SYNOPSIS use Storable; store %table, file; $hashref = retrieve(file); use Storable qw(nstore store_fd nstore_fd freeze thaw dclone); # Network order nstore %table, file; $hashref = retrieve(file); # There is NO nretrieve() # Storing to and retrieving from an already opened file store_fd @array, *STDOUT; nstore_fd %table, *STDOUT; $aryref = fd_retrieve(*SOCKET); $hashref = fd_retrieve(*SOCKET); # Serializing to memory $serialized = freeze %table; %table_clone = %{ thaw($serialized) }; # Deep (recursive) cloning $cloneref = dclone($ref); # Advisory locking use Storable qw(lock_store lock_nstore lock_retrieve) lock_store %table, file; lock_nstore %table, file; $hashref = lock_retrieve(file); The Storable package brings persistence to your Perl data structures containing SCALAR, ARRAY, HASH or REF objects, i.e. anything that can be conveniently stored to disk and retrieved at a later time. It can be used in the regular procedural way by calling store with a reference to the object to be stored, along with the file name where the image should be written. The routine returns undef for I/O problems or other internal error, a true value otherwise. Serious errors are propagated as a die exception. To retrieve data stored to disk, use retrieve with a file name. The objects stored into that file are recreated into memory for you, and a reference to the root object is returned. In case an I/O error occurs while reading, undef is returned instead. Other serious errors are propagated via die. Since storage is performed recursively, you might want to stuff references to objects that share a lot of common data into a single array or hash table, and then store that object. That way, when you retrieve back the whole thing, the objects will continue to share what they originally shared. At the cost of a slight header overhead, you may store to an already opened file descriptor using the store_fd routine, and retrieve from a file via fd_retrieve. Those names arent imported by default, so you will have to do that explicitly if you need those routines. The file descriptor you supply must be already opened, for read if youre going to retrieve and for write if you wish to store. store_fd(%table, *STDOUT) || die "cant store to stdoutn"; $hashref = fd_retrieve(*STDIN); You can also store data in network order to allow easy sharing across multiple platforms, or when storing on a socket known to be remotely connected. The routines to call have an initial n prefix for network, as in nstore and nstore_fd. At retrieval time, your data will be correctly restored so you dont have to know whether youre restoring from native or network ordered data. Double values are stored stringified to ensure portability as well, at the slight risk of loosing some precision in the last decimals. When using fd_retrieve, objects are retrieved in sequence, one object (i.e. one recursive tree) per associated store_fd. If youre more from the object-oriented camp, you can inherit from Storable and directly store your objects by invoking store as a method. The fact that the root of the to-be-stored tree is a blessed reference (i.e. an object) is special-cased so that the retrieve does not provide a reference to that object but rather the blessed object reference itself. (Otherwise, youd get a reference to that blessed object)..

Requirements: No special requirements
Platforms: Linux
Keyword: Data Fd File Libraries Papp Pappstorable Programming Reference To Retrieve Stdout Storable Store
Users rating: 0/10

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


PAPP::STORABLE RELATED
Libraries  -  File::Data 1.12
File::Data is a Perl module as a interface to file data. Wraps all the accessing of a file into a convenient set of calls for reading and writing data, including a simple regex interface. Note that the file needs to exist prior to using this...
13.31 KB  
File Cataloguers  -  File List Generator 1.0
ReStoring Data's File List Generator Freeware software filters, prints, and organizes via a file's: name, type, size, created date, and date last modified. It was developed by the Research and Development team to aid data recovery service clients...
5.63 MB  
Backup Utilities  -  File Repair 2.1
File Repair is the best tool to repair your corrupted files. It will scan your files, repair file errors and recover data in them as much as possible, so to minimize the loss in file corruption. File Repair repairs files corrupted due to virus...
1.02 MB  
Libraries  -  Storable 2.16
Storable package contains persistence for Perl data structures. SYNOPSIS use Storable; store %table, file; $hashref = retrieve(file); use Storable qw(nstore store_fd nstore_fd freeze thaw dclone); # Network order nstore %table, file;...
174.08 KB  
Libraries  -  Data::Startup 0.04
SYNOPSIS ###### # Subroutine interface # use Data::Startup qw(config override); $options = override(%default_options, @option_list ); $options = override(%default_options, @option_list ); $options = override(%default_options, %option_list...
74.75 KB  
Libraries  -  File::Drawing 0.01
File::Drawing release, revise and retrieve contents to/from a drawing program module. SYNOPSIS ########## # Subroutine interface # use File::Drawing qw( dod_date dod_drawing_number number2pm pm2number obsolete broken backup); $date =...
64.51 KB  
Libraries  -  File::DirCompare 0.3
File::DirCompare is a Perl module to compare two directories using callbacks. SYNOPSIS use File::DirCompare; # Simple diff -r --brief replacement use File::Basename; File::DirCompare->compare($dir1, $dir2, sub { my ($a, $b) = @_; if (!...
8.19 KB  
Libraries  -  File::Listing 5.805
File::Listing is a Perl module to parse directory listing. SYNOPSIS use File::Listing qw(parse_dir); for (parse_dir(`ls -l`)) { ($name, $type, $size, $mtime, $mode) = @$_; next if $type ne f; # plain file #... } # directory listing can...
235.52 KB  
Libraries  -  Clarion 1.01
Clarion is a Perl extension for reading CLARION data files. ABSTRACT This is a perl module to access CLARION 2.1 files. At the moment only read access to the files are provided by this package. "Encrypted" files are processed transparently,...
6.14 KB  
Libraries  -  File::Attributes 0.04
File::Attributes is a Perl module to manipulate file metadata. SYNOPSIS use File::Attributes qw(set_attribute list_attributes get_all_attributes); my $file = foo.txt; set_attribute($file, type => text/plain); set_attribute($file, encoding...
30.72 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