-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
- -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Is there any limitation to a PERL array size ?
If I was to load a MySQL database into an array...
or
open (FILE,"/somemonsterfile"):
while (<FILE>)
{
push @array, $_
}
Well, for starters, that's a fairly inefficient way to load a file into an
array. Try @array = <FILE>.
The answer to your question is: the limit is how much virtual memory you
have. Bear in mind that scalars (each array element is a scalar) have a
certain amount of memory overhead, and arrays themselves have some
overhead. So you can't load a 1Gb file into an array if you have 1Gb of
virtual memory.
The real answer, however, is almost certainly: "You're going about this the
wrong way." Why on earth you would read a huge file into memory is beyond
me. There are surely better ways to access your data. (Especially if it's
a MySQL database!)
- - --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
- -----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <
http://www.pgp.com>
iQA/AwUBP6WRD2PeouIeTNHoEQI1aACglkr5Yu7sXEMLXGkoB5yU05kwH6wAoPBn
mXhGm5GvfB44hj9p9QDJrchR
=N7/k
- -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <
http://www.pgp.com>
iQA/AwUBP6WRGWPeouIeTNHoEQJ8/wCeKkS0J1PHgAQ2FMCZpGM+a5J7noQAnAwc
Fng2S3wGhe35p1/V2o4slmQa
=TL1u
-----END PGP SIGNATURE-----