in reply to Pass local array by reference?
If you send an array (or any other variable type) by reference, remember to dereference it. You can do this by placing the variable type symbol in front of the $ sign i.e. @$array, $$scalar, %$hash. Once a variable is dereferenced, you can use it like you normally wouldsub FOO { my @array; #code here #Here is the pass to BAR &BAR(\@array); } sub BAR { my(@array) = @_; #This will receive the array from FOO #code here }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Pass local array by reference?
by hmerrill (Friar) on Jan 21, 2003 at 21:02 UTC |