Re: Pring array into a text file

From: toylet (toylet_at_mail.hongkong.com)
Date: 02/19/04


Date: Thu, 19 Feb 2004 17:07:35 +0800

how could yOu read them from file.txt and store in memory again?
is there a binary format for hash?

> my %hash = ( key1 => 'value1',
> key2 => 'value2',
> key3 => 'value3',
> key4 => 'value4');
>
> open OUT," > file.txt" or die "$!\n";
>
> while (my ($key, $value) = each %hash) {
> print OUT "Key: $key , Value: $value\n";
> }
> close OUT;
> Enough ?

-- 
   .~.    Might, Courage, Vision. In Linux We Trust.
  / v \   http://www.linux-sxs.org
/( _ )\  Linux 2.4.22-xfs
   ^ ^    5:06pm up 2 days 19:00 load average: 1.00 1.08 1.05


Relevant Pages

  • Re: Efficient access to large datafiles
    ... > getting to the point where my ASCII files are large (2 gigabytes or ... One problem I'm facing is memory usage. ... > when I had smaller domains, I store the data I wanted to use in my ... > I'm completely unfamiliar with fortran binary format and how, ...
    (comp.lang.fortran)
  • Re: Workaround with Remoting in CF
    ... > else you can store it in the Application Cache. ... >> I need a hash table in memory and clients accesing to it. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Parsing Large Files
    ... This gives me the hash %id which is keyed by ... Since you want to have the Y and X, store ... It is easier to sort in memory than ... to sort files from perl. ...
    (comp.lang.perl.misc)
  • Re: DBI (with Oracle) out of memory error
    ... Hashes need a lot of memory. ... With 280k hash keys, I estimate that your ... How much memory does your script use just before it runs out of memory? ... And I just prefer to store the data in a hash rather than ...
    (comp.lang.perl.misc)
  • Re: Memory-mapped persistent hash?
    ... Marshal.dump of your object, stores the object into the mmap, and then ... that memory location is stored in the Hash instead of the object. ... Except that the backing store is the system swap ...
    (comp.lang.ruby)