in reply to old file descriptors not being cleaned up

When you alter your script, make sure to do "Update:" at the bottom. In your first script, you used seek. I think that you where on the right track there. Now, to clear things up, add a dummy seek after sleep 1;
} sleep 1; seek(@pings, 0, 1) }