in reply to setting multidimensional array values

the 'x' operator is only going to work to give you strings. However, here's a time where I've found map to be very useful:
@{$array[$i]} = map {0} (1..3);

Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain

Replies are listed 'Best First'.
Re: Re: setting multidimensional array values
by da (Friar) on May 24, 2001 at 19:58 UTC
    For those who, like me, were puzzled about the idea of using 'x' in a list context, check out the 'perlop' manpage:

    Binary "x" is the repetition operator. In scalar context, it returns a string consisting of the left operand repeated the number of times specified by the right operand. In list context, if the left operand is a list in parentheses, it repeats the list.

    @ones = (1) x 80; # a list of 80 1's @ones = (5) x @ones; # set all elements to 5

    --- -DA