: : Ahhhh.. its not that line, but the line that reads in into the
: : array!
:
: (@location) = <FILE>;
: : Any ideas why an array would be having problems with that size of
: : information?
: :
: Probably because of the quantity of it. If you're loading a file with 10,000 lines that's about 5 MB, it's going to require more than 5 MB of RAM. Why? Perl internals. As a vast simplification, all individual items are stored in SVs (scalar values). An AV (array value) is implemented as a collection of SVs, probably arranged in some kind of tree structure to make array index lookup logarithmic or better (I don't know that, they could have something better in there). Each SV will have some overhead (data about the length of the value, reference count, etc) and the AV will have a little too. Perl is pretty efficient in general, but the runtime just needs that extra data to keep track of memory usage and the like. Still, I would *hope* it'd be able to manage this much even though it's not ideal.
:
: You're basically asking for a lot of memory, and it sounds like on a certain system it's just not willing to let you have it. Possibly the server has one of those CGI resource limiting things set up to stop scripts hogging lots of resources. Possibly there's something else getting in the way.
:
: Is there any reason you can not do it like this:-
:
:
while ($line = <FILE>) {
: # Do stuff with $line
: }
:
: Or don't put $line and the data will be in $_. That would probably be your best way to do it. This way all the data ain't read in at once, the file is just read one line at a time.
:
: Jonathan
:
: ###
: for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
: (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
: /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
:
:
Yah, i'm thinking its that there is a restriction on the ammount of memory I can use on the server.
Got it working with the while(<FILE>)!
Thanks again,
David