in reply to Memory Use and/or efficiency passing scalars to subs
Your use of prototypes isn't helping (but maybe you need that for some other reason).my $large_scalar = 'a huge string like 64K or something'; modify_largescalar(\$large_scalar); sub modify_largescalar { my $scalar_ref = shift; # Code to modify $$scalar_ref; }
Hope this helps - L~R
Updated after CombatSquirrel pointed something out I took another look at perldoc perlsub and conferred with belg4mit in the CB.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Memory Use and/or efficiency passing scalars to subs
by CombatSquirrel (Hermit) on Aug 30, 2003 at 15:23 UTC | |
by Limbic~Region (Chancellor) on Aug 30, 2003 at 15:38 UTC | |
by knexus (Hermit) on Aug 30, 2003 at 17:21 UTC | |
by Limbic~Region (Chancellor) on Aug 30, 2003 at 17:34 UTC |