in reply to system($cmd) spawns infinitely
One way to get into an infinite loop would be to have a script recursively call itself. Not that I'm speaking from bitter experience, of course...