in reply to A new perl {cough} feature?

It's apparently an auto-vivification problem, caused by iterating over the entire structure? Using the following subroutine instead of the grep produces the same results:
dump_matrix(); sub dump_matrix { for my $i (0..2) { print "row: $i [ "; for my $j (0..3) { print "$matrix[$i][$j], "; } print "]\n"; } }
What's interesting is how two consecutive calls to Data::Dumper without intervening code does not reproduce the anomaly (even if you pass by reference). Makes me wonder how Data::Dumper is traversing the structure.

--Jim

Update: Ah. Thanks tachyon, I would've researched it but I've been competing for computer time today. Five year olds always win :(

Replies are listed 'Best First'.
Re: Re: A new perl {cough} feature?
by tachyon (Chancellor) on Feb 17, 2002 at 20:19 UTC

    Makes me wonder how Data::Dumper is traversing the structure

    Data::Dumper is an XS module so it does it in C

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

      Actually its both.

      When I get some time i'll check to whether the pure perl version does the same thing.

      Yves / DeMerphq
      --
      When to use Prototypes?