in reply to Re: Re:(4): •Re: Upgrade B::Deparse?
in thread Upgrade B::Deparse?

Bah. I'm a moron. Reading farther into Storable it already describes it's strategy for shared things. It doesn't unless you you pass in the other things that care about the shared thing. So all that blather about references and lexicals is already solved (or the strategy is defined anyway). I fall back to my original question that I don't see what the big deal is. I may still be a moron but at least I think I'm asking in the right area.

__SIG__
printf "You are here %08x\n", unpack "L!", unpack "P4", pack "L!", B::svref_2object(sub{})->OUTSIDE

Replies are listed 'Best First'.
•Re: Re: Re: Re:(4): •Re: Upgrade B::Deparse?
by merlyn (Sage) on Oct 03, 2002 at 18:50 UTC
    It matters if you're trying to save and restore something like this:
    sub return_getter_setter { my $value = shift; (sub { $value }, sub { $value = shift }); } my ($getter, $setter) = return_getter_setter(42);
    If I save both $getter and $setter in the same batch, I'd expect that when they are restored, they still both share the same secret lexical. I do believe that the current code deparser cannot be used for this at the moment, and that it's a difficult task. The problem is that when you deparse the text for $getter, you have to put some placeholder for $value, and when you deparse $setter, you still have to put some placeholder for that $value. But how do you know the two share the same placeholder?

    -- Randal L. Schwartz, Perl hacker