http://www.perlmonks.org?node_id=1090536


in reply to Backtick caught in infinite loop

Although it would certainly help, you don't have to post the original script - but you can whittle it down to a Short, Self Contained, Correct (Compilable), Example (http://sscce.org/) that reproduces the problem. Otherwise, we'll just be guessing.

the rest of my perl script does not run

How did you determine this? Have you tried printing something just after the backticks?

instead the command starts to run again

Unless the script is programmed to go back and attempt to run the command again (the backticks are inside a loop, sub, or after a label), or the script itself is being run again through some mechanism you haven't told us about, this seems really unlikely. Have you tried running the exact same command from the command line?

I was thinking about adding something like

Better to diagnose the problem instead of attempting solutions... Basic debugging checklist

Replies are listed 'Best First'.
Re^2: Backtick caught in infinite loop
by tau1777 (Initiate) on Jun 20, 2014 at 02:29 UTC

    Thank you for all the tips. I will try to come up with a short example code. In the meantime I can answer some of your questions.

    I have not tried printing something, so this simple check is on top of my list. The backticks are not inside any sort of loop structure. I am sure, but I will double check this matter. I have not run it from the command line, but I did have sucess running it inside of a system call. The only issue was the output form the system call was not captured, and so this caused other errors.

    Oh, thanks for the debug checklist, I've definitely got #1, now to start knocking away at the rest.