in reply to Re^2: Array comparison for 3 arrays
in thread Array comparison for 3 arrays

Don't use postfix for. :)

my @array = $arrays->{$array_name}; for my $number (@array) { $result->{$number}->{$array_name} = 1 }

Replies are listed 'Best First'.
Re^4: Array comparison for 3 arrays
by GrandFather (Saint) on Apr 14, 2010 at 09:16 UTC

    There is no need to be excessively verbose when expounding on the subject at hand. It helps if you get the syntax right in your example code too.

    for my $number (@{$arrays->{$array_name}}) { $result->{$number}{$array_name} = 1; }

    The @{...} is required to dereference the array reference which is the hash value. Without the dereference syntax @array is assigned (or the loop iterates over) a single element which is the reference to the array.

    True laziness is hard work