Hi all,
Ruby 1.6.7 on Solaris 9
This question refers back to the client/server program I posted in the
"Problems with Marshal" post.
In the sample server from that post (using read/write instead of
gets/puts this time), if I do this:
s = Struct.new(“TestStruct”,:name,:age)
s1 = s.new(“Dan”,29)
s2 = s.new(“Mary”,33)
a = []
a.push(s1,s2)
x = Marshal.dump(a)
and then, in the sample client I do this:
a = Marshal.load(v)
a.each do |s|
puts s[:name]
puts s[:age]
end
I get this:
(eval):17:in load': (eval):17:in
load’: uninitialized constant
TestStruct at Struct (NameError)
-line 17 is the ‘load(v)’ line.
Any ideas?
Regards,
Dan