in reply to passing array references
You could turn the problem around and instead of returning references to results pass in references to where you want the results stored.
sub foo { my( $s, $a, $s1, $a2 ) = @_; ${$s} = 42; @{ $a } = 0..5 ${$s1} = sin( 1 ); @{ $a2 } = qw( yadda yadda yadda ); return; } foo( \$a, \@b, \$c, \@d );
Update: Oop, left off making scalars references as well
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: passing array references (OT)
by graq (Curate) on Dec 06, 2004 at 10:58 UTC |