Perl lists scale dynamically to fit the amount of data you
stick in them. The amount of data you can stick into a
list is limited only by the amount of memory you have available.
I have used perl lists with millions of entries
and never had a problem.
You may want to see my
Shift, Pop, Unshift and Push with Impunity!
post for a look at the performance characteristics of
perl lists.
I doubt your problem is really with a full list.
Why don't
you post your code so we can see if we can
figure out what the
problem is?
| [reply] |
Thank you for the quick reply. I made a mistake in writing the question. Actually, I was actually inquiring about the maximum size of variable and increasing its size but instead wrote an array. Would you be kind enough to shed some light on this? Thank You!
| [reply] |
| [reply] |
is there a max size of a scalar? i'm pretty sure it too is dynamically growable as needed... it's not necessarily pretty or effecient when it gets that large.. but I've never run into a size limit with vars/scalars.... | [reply] |
No. "fills available memory" is more likely to be your upper bound than any
arbitrary "power of two minus one" that most other languages limit you at.
The only common limit you may bump into is the length of a Perl identifier.
255 characters before Perl 5.6, and lifted to unlimited in 5.6!
-- Randal L. Schwartz, Perl hacker
| [reply] |
Actually I have been very impressed with how efficient Perl
is on performance. Memory, well that is another story.
But try this:
foreach (1..1000000) {
$str .= "hello\n";
}
Now try its equivalent in another language, like C++,
JavaScript, etc.
Impressed yet? You should be! | [reply] [d/l] |