Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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); }


thanks!

Comment on return values are undef after return
Download Code
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2015-07-30 23:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls