I've never used a my outside of a sub before, just saw that used in another file. Maybe put it inside the spawn? Not sure if that will change the scope of it though, which will negate what I was doing...
Or try my $started = 0;
That's the only thing I could think of that would be wrong here.
|