Released the new version of DDS yesterday. Diotalevi from perlmonks worked with me to make it handle a couple of special cases in a much better way.
The main new features are that weakrefs, overloaded objects and closures are all now dumped properly. In particular the lexicals that are bound to a closure a dumped along with it. AFAIK this is the first tool ever to have this feature.
Thanks dio.
Re: (Score:1)
Re: (Score:1)
D:\Development>perl -MDDS -e"my $closure=do{ my $x=100; sub { $x++ } }; Dump $closure"
my ($x);
$x = 100;
$CODE1 = sub {
$x++;
};
I can break this... (Score:1)
I thought about trying to solve this with intelligent mangling, but there is always a boundary case. For instance if you mangle anything with $x_eclipse_1 in some way (eg make it $x__eclipse_1), what if there is a global variable $x_eclipse_1? Now you've changed semantics or else get a crash.
After
Re:I can break this... (Score:1)
The following code crashes.
Shoot. Yep. It does. And it highlights what I forgot to document: the subs being dumped shouldn't mix the use of dynamics and lexicals with the same name, and that its is unwise to use variables matching /_eclipse_\d+$/. (Which personally I think is not such a terrible restriction, albeit not at all ideal.)
Dealing with the former is actually very tricky, and probably wont ever be solved properly. A good example is
my $a=sub { $a++ };
The second issue regarding eclipsed
I can break this again... (Score:1)