out of memory

A

aniait

Is there any way to solve the 'out of memory exception' of perl on
windows? I got this when i tried to dump a large hash into a file
using Dumper.
 
S

smallpond

Is there any way to solve the 'out of memory exception' of perl on
windows? I got this when i tried to dump a large hash into a file
using Dumper.


Do you have to use Dumper on the whole hash?

What's wrong with:

foreach my $key (keys %myhash) {
print FH $key,":",$myhash{$key}, "\n";
}

or even:

foreach my $key (keys %myhash) {
print FH "KEY=",$key,"\n", Dumper($myhash{$key}),"\n";
}
 
T

Ted Zlatanov

a> Is there any way to solve the 'out of memory exception' of perl on
a> windows? I got this when i tried to dump a large hash into a file
a> using Dumper.

Try it with the YAML module, you may have better luck (and the results
are quite readable). In general as smallpond suggested you may just
have to do it key by key.

Ted
 
B

Ben Morrow

Quoth aniait said:
Is there any way to solve the 'out of memory exception' of perl on
windows? I got this when i tried to dump a large hash into a file
using Dumper.

Increase the size of your swapfile :). Windows machines usually don't
have anywhere near enough swap.

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top