listentome has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am running a suite of batch files and my perl script helps in reading the path of the batch file from a text file and then executes the same. The problem I am facing is that at times the script prints it as passed though the batch file has not been executed. How do I prevent this from happening?

  • Comment on How to prevent the perl script from skipping execution of certain batch files?

Replies are listed 'Best First'.
Re: How to prevent the perl script from skipping execution of certain batch files?
by moritz (Cardinal) on Feb 23, 2010 at 10:33 UTC
    You need to check if your perl script actually executed something. How that works depends on how the script runs the batch files. If you do it with system, the documentation describes in detail how you can check for errors.
Re: How to prevent the perl script from skipping execution of certain batch files?
by cdarke (Prior) on Feb 23, 2010 at 10:35 UTC
    You need to find out why the batch file has not been executed. You may need to test $? and/or $! or even $^E, depending on how you are running the batch files. There are many ways of doing that, and without seeing your code we can only guess.