Syntactic Confectionery Delight | |
PerlMonks |
Re: Re: Re: Re: Re: Optimizing existing Perl code (in practise)by gmpassos (Priest) |
on Aug 23, 2002 at 03:26 UTC ( [id://192256]=note: print w/replies, xml ) | Need Help?? |
"I'd try to avoid that by passing a reference to the large scalar to the sub instead"
Better point! :) The reference is another good way! But is good only if you just want to past the data through the sub, because you can't read or edit it before parse the reference, and when you parse it you duplicate again the data in the memory.
Of course that the best idea is always the simplest, why not put the variable with the "big data" in global (without 'my' or 'local'), to be read by all the program? "The creativity is the expression of the liberty".
In Section
Seekers of Perl Wisdom
|
|