On Thu, Nov 11, 1999 at 11:56:15AM -0500, John Porter wrote: > In <19991102214104.A74@monk.mps.ohio-state.edu>, > Ilya Zakharevich <ilya@math.ohio-state.edu> wrote: > > How one would > > write a "universal" unmarshaller? Obviously, one needs to store > > unmarshalling instructions together with stringified data. > > > > This leads to unpack 't' which I wrote. > > I would like to see this (New Year's wish): > > # -- on the sending side: > > $msg = pack 't', \&foo; > > # -- on the receiving side: > > sub foo; > ( *foo ) = unpack 't', $msg; I do not think such complicated functionality belongs to the "builtin" pack. When serialization of globs and subs becomes feasible, one can design a hook for pack to serialize these things. 'unpack' already has such hooks: it can call an arbitrary function for postprocessing of the unpacked data. So the hook for 'pack' might store a string combined with the extraction template ')T2/3A6 do_sub' This template says that the following packed string should be extracted as with C<unpack 't'>, then should be given as argument to do_sub($whatever). Hope this helps, IlyaThread Previous | Thread Next