in reply to Creating an array of hash references

Maybe I'm not understanding what you mean... If that the server and client are separate processes, then you aren't really passing a hash from one to the other; you're passing a stream of bytes, which need to be split or parsed somehow into a hash (a series of key/value pairs) in the client.

Does the client receive a sequence of distinct hashes in a single stream? If so, how do you know the boundaries between hashes?

But the main question is: how do you know when you are finished reading? I would tend to use a "read()" call in this situation, or maybe sysread, and maybe play with ioctl's or fcntl's in order to do non-blocking reads from the server. Put all the input data into a scalar in the client, and after the reading is done (and there's time to process it), use unpack or split or whatever to break the stream up into the hash(es).

  • Comment on Re: Creating an array of hash references