in reply to Re^2: syntax of multidimensional arrays and hashes
in thread syntax of multidimensional arrays and hashes

The weird part here is that $tsize[$tnum] has pretty much no useful meaning in the code. In a list context, @{$threads{$thread}} has all the values in $threads{$threads}. In a scalar context @{$threads{$thread}} is the number of things in the @{$threads{$thread}} list.

$tsize[$tnum] = @{$threads{$thread}};
doesn't appear to have any real meaning or usefulness.

use @{$threads{$thread}} instead of trying to assign a scalar value to a 'C' style @tsize array.

Replies are listed 'Best First'.
Re^4: syntax of multidimensional arrays and hashes
by hsfrey (Beadle) on Jul 19, 2009 at 04:43 UTC
    I'm going to use @tsize a lot later, eg: to sort all the arrays, so I wanted to access it easily in parallel with the other arrays. And Yes, you've outed me! <G> I'm really a C programmer at heart! It'll take a while before I start thinking in Perl. In any case, $tsize is unrelated to my problem of being unable to retrieve the elements of the array members of the hash.