in reply to Reading an incoming Data Stream..

a small note aside:
use strict 'refs'; use strict 'subs'; #later use strict;
When you use strict without an import list all strict pragma variants will be applied, so it is equal of saying "use strict 'refs','subs','vars';" :-)

Have a nice day
All decision is left to your taste