From: Albert Wagner Date: 2002-01-05T12:59:39+09:00 Subject: [ruby-talk:30265] Structs and Marshalling I keep getting myself tripped up when I Marshal Struct objects. I typically create a class thus: recordClass = Struct(*symbols) And instances: record = recordClass.new(*fields) This allows me to create records from csv text files without having to write specific code for each file: , are simply the field names in the first line of text and are the delimited text fields. The problem arises when I attempt to read the file and unMarshal records. I can create an "identical" recordClass but Marshal chokes on it. I suppose because it is not the "same" recordClass used in writing. At least I think that is my problem. If anyone else has Marshalled Structs, perhaps you can offer some caveats to keep me out of trouble. Maybe I shouldn't be using Structs this way at all. Thanks ahead for any help. Albert