in reply to array of arrays - context problem

Others have explained how to get the results you want.

For the benefit of potentilal newbies, here is a clarification on what went wrong with the original code :

my @masterarray = qw(@array1 @array2 @array3);
It did NOT DWIM !

As you have discovered, that code is equivalent to :

my @masterarray = ('@array1','@array2','@array3');
and this is clear in examples the documentation for qw (perldoc perlfunc).

Although it is not explicit in the documentation, the qw operator DOES NOT INTRAPOLATE.

    ..."I don't know what the facts are but somebody's certainly going to sit down with him and find out what he knows that they may not know, and make sure he knows what they know that he may not know, and that's a good thing. I think it's a very constructive exchange," --Donald Rumsfeld

Replies are listed 'Best First'.
Re^2: array of arrays - context problem
by chb (Deacon) on Jan 14, 2005 at 06:54 UTC
    Actually it is explicit in perldoc perlop in the table under the heading Quote and Quote-like Operators