in reply to Another "out of memory!" problem
I'm finding when the hash gets to be more than 27,000, I get the out-of-memory error.
hum, that's really not that big. Especially if it just hold URLs. You should see the following surpass that number in no time.
my $i; my %urls; for (;;) ++$url{"http://www.perlmonks.org/?node_id=".++$i}; print("$i\n") if $i % 1000 == 0; }
Tie a shoelace around a shoebox and wave a magic wand over it.
Actually, that's quite an apt description!
tie is a form of magic (yes, that's really what it's called) that ties methods to a variable (shoebox) such that those functions are called in response to the different actions taken on that variable. For example, $tied = $x; calls the tied variable's STORE method.
It's easier to understand if you look at it from the other end. tie allows a module to use a Perl variable as its interface. Instead of $obj->store($x), it allows $obj = $x;.
|
---|