in reply to IO::Socket leaves me hanging
After fixing the typos, your script works for me (and doesn't hang at the end). Just a data point.