http://www.perlmonks.org?node_id=1010353

perlaintdead has asked for the wisdom of the Perl Monks concerning the following question:

hello, monks. My question is:
There is a potentially large amount of data in array @DBread and is return'd. After it is return's is the @DBread empty'd? I'm going to be forking in other parts of the program so i need as little memory used as possible. (i know i can read a file line by line but will do that later.) This is a more academic question more than a practical one

sub readDB{ my $DBtoread = shift; my $FILEREAD; open($FILEREAD, "+<", "./database/$DBtoread"); my @DBread = <$FILEREAD>; close($FILEREAD); return(@DBread); }


thanks!