in reply to •Re: Puzzle: Whats wrong with Dumper
in thread Puzzle: Whats wrong with Dumper

So it appears. :-)

I am well aware of your bug report (its a test case for my BFDump) but for various reasons I had this one down as a seperate issue. :-)

Incidentally to answer your (implicit) question from the bug report:

I'm not sure how to fix this... you really need to dump $dogs before $kennel here so you can take a reference to the array element in place. Or it has to be patched up afterward. I'm turning Purity on, which is usually pretty good about constructing the patchups. But it wasn't sufficient here.

Theres a simple way to solve this problem, but nobody will like it: Dumper must make two passes over the data structure. The first to identify every variable in the data structure, the second to actually dump the structure using that data.

I leave it as an excercise for the reader to see why it is impossible to dump any arbiitrary perl data structure with only one pass (as Dumper attempts to do).

Incidentally BFDump does handle your perl5-porter bug, but doesnt handle this one (yet).

Yves / DeMerphq
---
Writing a good benchmark isnt as easy as it might look.

  • Comment on Re: •Re: Puzzle: Whats wrong with Dumper