in reply to Arrays and Scalar Parameters
The reason this won't work the way you think: (@ary1, $num) = read_data(\@tmpary, $tmpsclr);is documented in the documentation on subs. The return from a sub is always a flat list. Perl shoves everything into @ary1, leaving $num empty.
A reasonable alternative is to return an array ref and a scalar:
($ary1ref, $num) = read_data(...); @ary1 = @$ary1ref; # silly, but gets the point across # ... later ... sub read_data { # ... return \@retary, $count; }
HTH
|
|---|