Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Backtick caught in infinite loop

by Anonymous Monk
on Jun 20, 2014 at 01:34 UTC ( #1090536=note: print w/ replies, xml ) Need Help??


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


Comment on Re: Backtick caught in infinite loop
Select or Download Code
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1090536]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2014-10-26 06:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (151 votes), past polls