PS. I suppose you realise that the array @a which you declare twice and assign to once is never used anywhere? I'm guessing this is left over from some debugging or such?
Yes, the code works otherwise, and @a was an attempt at something that also didnt work, but I'm more concerned about forking the process of pinging the node.
I havent thought about moving the waitpid to outside the loop either. I'll give that a shot.