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)]); }

In reply to Re: I've read perlref by matija
in thread I've read perlref by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.