> There's one problem with this modules.  DT.pm relies on the time zone
> object returning a value from the name() method, that when fead to
> DT::TZ->new, will recreate the original object.  This is used in DT.pm's
> Storable hooks in order to avoid saving the whole time zone object.  Right
> now, if someone were to freeze and thaw a DT object which used an LMT time
> zone, it would probably throw an error when they tried to thaw it.
>
> One possible fix is to have name() return undef for your object, and then
> DT.pm can explicitly check for this, and save the whole object.
>
> The downside to this is that it would mandate that all time zone
> implementations outside the DT::TZ core return undef for name().
>
> Other suggestions are welcome.

We could require that all 'external' time zome implementations have storable hooks of 
their own.  Then STORABLE_freeze() in DT could check for the hook and call it 
directly.   The downside is it will bloat the size of serialized DT objects as we'll 
have to store the class name of the TZ object.

-J

--

Reply via email to