Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

return values are undef after return

by perlaintdead (Scribe)
on Dec 26, 2012 at 10:39 UTC ( #1010353=perlquestion: print w/replies, xml ) Need Help??
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); }


Replies are listed 'Best First'.
Re: return values are undef after return
by Anonymous Monk on Dec 26, 2012 at 11:09 UTC
      so after reading that tut i am confuzzled as to whether i should be undef'ing the array or any variables in general

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1010353]
Approved by Old_Gray_Bear
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2016-10-24 20:56 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (309 votes). Check out past polls.