$write_set is a scalar - a reference to an IO:Select object. Making that scalar sharable does not make the thing it references sharable.
Your post is remarkably similar to
this which dates from June 2005. It looks like you cut and pasted it. How come?