in reply to What is wrong with the code ?

The each() function only has ONE iterator per hash. You'll have to use keys().
for my $k1 (keys %hash) { for my $k2 (keys %hash) { next if $k1 eq $k2 and $skip_identical_keys; $cart_prod{$k1}{$k2} = ...; } }

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

Replies are listed 'Best First'.
Re^2: What is wrong with the code ?
by vennirajan (Friar) on Jan 18, 2006 at 08:14 UTC
    Do you mean that single pointer will be used for each data structure and that pointer also will be shared ?

    Regards,
    S.Venni Rajan.
    "A Flair For Excellence."
                    -- BK Systems.
      No. %data has one iterator. %foo has one iterator.