You could serialize it and then send it over a raw TCP socket, yes. Or you could use a higher level protocol like XML-RPC or HTTP.. HTTP Mechanize on one side and CGI on the other is probably the most mature as far as built-in error handling and stuff, most code for cop-paste re-use etc..