Why preallocate when perl autovivifies?
Haimov, Eugene wrote:
Why do you need to pre-allocate it ? ( Not to mention that [%hash = 10_000;] is not the proper way to do it ).
Eugene Haimov www.artisolve.com
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of James Hooker Sent: Friday, August 13, 2004 2:27 PM To: '$Bill Luebkert'; James Hooker Cc: '[EMAIL PROTECTED]' Subject: RE: Maximum Hash key length?
I am trying to Preallocate memory for the hash with
This defines 10,000 key/value pairs. %hash = 10_000;
How do you pre-define key/value pairs for $hash{key1}{key2}{key3} ?
James C. Hooker Marconi - TAC 1755 N. Collins Suite 400 Richardson, TX 75080 mobile: 214.498.9634 office: 972.669.6323 Please send all Technical Support requests to: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> or call 1-877-777-7441 For support information, software updates and FAQ's please visit our support website at: http://www.marconi.com/html/products/wnpproductsupport.htm
-----Original Message-----
From: $Bill Luebkert [mailto:[EMAIL PROTECTED] Sent: Friday, August 13, 2004 1:25 PM
To: James Hooker
Cc: '[EMAIL PROTECTED]'
Subject: Re: Maximum Hash key length?
James Hooker wrote:
Does anyone know what the maximum length of a hash key can be. I am using very long string names for keys in a hash. Does anyone know
what the key length limit is?
Some simple trial and error yields 251 characters.
$key = "keyname....................
$hash{$key} = $somevalue;
Also, does anyone know how to predefine the length of a hash with multiple keys?
I don't think multiple keys has any bearing (I have been wrong once or twice though).
This defines 10,000 key/value pairs. %hash = 10_000;
How do you pre-define key/value pairs for $hash{key1}{key2}{key3} ?
Not sure what you mean. Do you mean how do you statically init that hash or dynamically set it or what ?
--
SKYKING, SKYKING, DO NOT ANSWER.
_______________________________________________ ActivePerl mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
