On Sun, Apr 28, 2013 at 01:55:21AM +0100, me said: > So my second thought is to have a struct This seems to basically be what PHP::Serialization::XS does http://cpansearch.perl.org/src/KULP/PHP-Serialization-XS-0.06/XS.xs