in reply to Array Woes

You never reset $connected. Once it's set to 1, it never becomes false again. Limit the scope of your variables. If you make $connected lexical in the check sub, you might see better results.

Abigail