in reply to Array reference problem

$name = sprintf "%s%s",'descriptor_array',$array_no; print @$name;
Since $name contains a string, @$name will access a package variable - not a lexical variable introduced with my.

Either use our, or use a hash (or array) of arrays, instead of using the names directly.

Replies are listed 'Best First'.
Re^2: Array reference problem
by hda (Chaplain) on Jul 07, 2009 at 16:14 UTC
    Thanks, that worked. However, I can't understand why one of these two 'families' of arrays can be accessed whereas the other not.
      Because only for package variables does the lookup happen at runtime.