in reply to I've read perlref

When you are experimenting with new things, always run with -w ON:
Scalar value @Array[0] better written as $Array[0] at /tmp/t line 17. Unquoted string "some" may clash with future reserved word at /tmp/t l +ine 17. Scalar value @Array[1] better written as $Array[1] at /tmp/t line 18. Unquoted string "some" may clash with future reserved word at /tmp/t l +ine 18. Unquoted string "more" may clash with future reserved word at /tmp/t l +ine 18. main::thing() called too early to check prototype at /tmp/t line 2. Not enough arguments for values at /tmp/t line 17, near "values]" Not enough arguments for values at /tmp/t line 18, near "values]"
But I think your biggest problem is the first line of thing, where you say:
($REF_array)=@_;
That makes a copy of the array. You are no longer assigning to the references to the original arguments, and thus your values are lost once you get out of the subroutine...

I think what you want is more akin to this:

sub thing() { ${$_[0]}[0]=([qw(some values)]); ${$_[0]}[1]=([qw(some more values)]); }

Replies are listed 'Best First'.
Re: Re: I've read perlref
by Fletch (Bishop) on Mar 11, 2004 at 13:35 UTC
    ($REF_array)=@_;
    That makes a copy of the array. You are no longer assigning to the references to the original arguments, and thus your values are lost once you get out of the subroutine...

    Technically that makes a copy of the array reference. The @Array = @{$REF_array} is what makes a copy of the array referenced. The rest of your diagnostic is correct (the original arrayref is untouched by modifications to @Array). </pedant>