05-01-2008
Quote:
Originally Posted by
andrew2325
That still doesn't answer my question!
![EEK! Smilie](https://www.unix.com/images/smilies/eek.gif)
It does.
I do expect that you at least know what a hash is in Perl and how you add key-value pairs to it and retrieve something from it. So, you were asking how to persist the data to a file so that you can recover it later, and so I suggested Storable demonstrating how to save to and restore from a file using an example. It's all in the docs and I already provided you with the link to the man page in case you are so impatient to locate the man page yourself.
If you don't understand the example, run it and see the results yourself. If you are totally new to Perl, you should first learn the basics of the language yourself and we can never teach Perl here with so limited space.
I think I have already provided you with everything that is relevant as far as I conceive.
So tell me, in what ways can I serve you better?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
Help me with some good links of Hash with in Hash .(Multidimensional hash)..
Regards
Harikrishna (1 Reply)
Discussion started by: Harikrishna
1 Replies
2. Shell Programming and Scripting
hi
i have two hash achi %disk1,%disk2 with( key, value) (key1,value1)
How to store it in another hash..
Plz replyyy.
Regards
Hari (1 Reply)
Discussion started by: Harikrishna
1 Replies
3. Shell Programming and Scripting
i want to ask is it i can use hash in perl to store a page number with a list of words which is in that page and then print it out?
Example
Page 1 contains a are boy cat ............. (a list of sorted words)
how can i store it in a hash?
Thank you (3 Replies)
Discussion started by: mingming88
3 Replies
4. Shell Programming and Scripting
This is my data
1 0
1 0
1 1
1 2
1 6
1 7
Assume that first field is key and 2nd field is value
I want to create a hash in perl, on this data. My hash should having uniq key and all values by , separated.
1,0,0,1,2,6,7
1 will be my key and rest of are should be values. (3 Replies)
Discussion started by: pritish.sas
3 Replies
5. Shell Programming and Scripting
Hi i am reading one file and creating Hash from the contents of it my issue is there are 3 different files in 3 different locations having same structure so for parsing these files i have one subroutine which returns hash after reading all the 3 files i need to create consolidated hash from three... (2 Replies)
Discussion started by: zedex
2 Replies
6. Shell Programming and Scripting
Can Someone explain me why even using Tie::IxHash I can not get the output data in the same order that it was inserted? See code below.
#!/usr/bin/perl
use warnings;
use Tie::IxHash;
use strict;
tie (my %programs, "Tie::IxHash");
while (my $line = <DATA>) {
chomp $line;
my(... (1 Reply)
Discussion started by: jgfcoimbra
1 Replies
7. Shell Programming and Scripting
Hi,
In Perl, is it possible to use a range of numbers with '..' as a key in a hash?
Something in like:
%hash = (
'768..1536' => '1G',
'1537..2560' => '2G'
);
That is, the range operation is evaluated, and all members of the range are... (3 Replies)
Discussion started by: dsw
3 Replies
8. Shell Programming and Scripting
Hi ,
i have the below code its working fine when i execute in unix , but its not working in windows could you pls explain me where i am going wrong.
This is the program
$data = { '1' => 'one' ,
'2' => 'two' ,
3 => 'three'
};
print "hello : $data->{'1'}... (2 Replies)
Discussion started by: ragilla
2 Replies
9. Shell Programming and Scripting
Hi,
I have an hashes of hash, where hash is dynamic, it can be n number of hash. i need to compare data_count values of all .
my %result (
$abc => {
'data_count' => '10',
'ID' => 'ABC122',
}
$def => {
'data_count' => '20',
'ID' => 'defASe',
... (1 Reply)
Discussion started by: asak
1 Replies
10. Programming
My issue is that the perl script (as I have done it so far) created empty branches when I try to check some branches on existence.
I am using multydimentional hashes: found it as the best way for information that I need to handle. Saing multidimentional I means hash of hashes ... So, I have
... (2 Replies)
Discussion started by: alex_5161
2 Replies
LEARN ABOUT OSX
dbix::class::serialize::storable
DBIx::Class::Serialize::Storable(3) User Contributed Perl Documentation DBIx::Class::Serialize::Storable(3)
NAME
DBIx::Class::Serialize::Storable - hooks for Storable nfreeze/thaw
DEPRECATION NOTE
This component is now DEPRECATED. It has not been providing any useful functionality for quite a while, and in fact destroys prefetched
results in its current implementation. Do not use!
SYNOPSIS
# in a table class definition
__PACKAGE__->load_components(qw/Serialize::Storable/);
# meanwhile, in a nearby piece of code
my $cd = $schema->resultset('CD')->find(12);
# if the cache uses Storable, this will work automatically
$cache->set($cd->ID, $cd);
DESCRIPTION
This component adds hooks for Storable so that row objects can be serialized. It assumes that your row object class ("result_class") is the
same as your table class, which is the normal situation.
HOOKS
The following hooks are defined for Storable - see the documentation for "Hooks" in Storable for detailed information on these hooks.
STORABLE_freeze
The serializing hook, called on the object during serialization. It can be inherited, or defined in the class itself, like any other
method.
STORABLE_thaw
The deserializing hook called on the object during deserialization.
AUTHORS
David Kamholz <dkamholz@cpan.org>
LICENSE
You may distribute this code under the same terms as Perl itself.
perl v5.16.2 2012-10-18 DBIx::Class::Serialize::Storable(3)