just a shot in the dark, but does the c program you are running this under have permission to run the perl script in question,
Do you get the same thing when you try to run the script from the command line?
Yes, it has the permissions and the first approx 6000 times the
executions of the perl skript are without problems.
I'm starting the Program with a bash skript usually from
crontab but the problem also occurs when i start it from a
command line (xterm).