in reply to Re: Re: Re: Re: Memory Use and/or efficiency passing scalars to subs
in thread Memory Use and/or efficiency passing scalars to subs
Notice the \ in front of the $large_scalar. This makes an explicit reference to the variable. Then inside the sub, shift off the reference into a properly named variable.modify_large_scalar(\$large_scalar);
I have been following this thread and you said that it was taking up to 13 hours to run. Chances are there are other ways to improve the efficiency of the code. You might want to post all of your code (inside readmore tags if it is long) to see if we can't come up with some more efficient ways of accomplishing the same thing. Additionally, you should look into modules like Benchmark and Devel::Profile to see if the problem is where you think it is.sub modify_large_scalar { my $large_scalar_ref = shift; # Code to modify $$large_scalar_ref }
Cheers - L~R
|
|---|