From: Andrew Mitchell Date: 2008-05-23T17:33:28+09:00 Subject: Re: customized serialization unreliable???? > def marshal_dump() > return [@version,@data] > end If there are actually classes built on instance methods marshal_dump and marshal_load, then Marshal would be completely ignoring those methods. Assuming you meant "_dump" which is the instance method to overload for customized serialization, and either "self._load" or klassname._load which is the class method for the same, then this would be happening: Array.to_s will be called in Marshal.dump because it expects a string. For example, with the YYY class: @version = 1 @data = ["e", "i"] _dump returns [1, ["e", "i"]] The Marshaling process will form "1ei" Your Loading process with "1ei" will give @version = 1 @data = "e" # instead of ["e", "i"] If for whatever reason you are Marshaling the results of your marshal_dump methods -- Marshal.dump(my_yyy.marshal_dump) --, then you have neglected to properly handle object graph cycles, and shared references. Further, from the ruby-doc Marshal class: "Some objects cannot be dumped: if the objects to be dumped include bindings, procedure or method objects, instances of class IO, or singleton objects, a TypeError will be raised." -- Posted via http://www.ruby-forum.com/.