>>>>> "Jenda" == Jenda Krynicky < Jenda%40Krynicky.cz">Jenda
Krynicky.cz> writes:
Jenda> From: merlyn%40stonehenge.com">merlyn
stonehenge.com
>> >>>>> "Vijaya" == Vijaya Kumar < mp_vijayakumar%40yahoo.com">mp_vijayakumar
yahoo.com> writes:
>>
Vijaya> How many elements can be stored in an array? I mean, is there any
Vijaya> maximum limit for an array? If anybody knows, please answer.
>>
>> Perl imposes no limits, but it's certainly limited to whatever fits into the
>> addressing space of a process on your system, because data is all
>> memory-resident.
Jenda> I kinda doubt it. The index of an array is an integer so I'd expect
Jenda> the maximum limit to be your size of integers.
Jenda> Which means
Jenda> use Config;
Jenda> $maxint = 2 ** ($Config{intsize}*8 - 1);
Jenda> The limit looks way big enough so I doubt Perl bothers to check
Jenda> whether it needs to promote to something bigger as the array grows.
But I believe the standard "integer" size is always supposed to exceed the
number of addressable bytes for a given architecture. Given that each Perl
Scalar is some number (16?) bytes at a minimum, you already lose a few bits
worth of the number of possible scalars, so I think you're in the clear.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
< merlyn%40stonehenge.com">merlyn
stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
.