No, qsub submits the job correctly and the job starts as well and runs in the background. But, the moment job gets submitted and before the job is finished, it comes back to the next statement in perl (e.g. "if" statement) and executes it and then exits the perl program.
I need the perl program to just wait after submitting the qsub job and till it is finished, and then go to the next statement (i.e. "if" statement)
thanks..
I know this was posted a long time ago but I came across the same problem and in case it might help someone else, I solved it by using the "-W block=true" qsub option for PBS systems(i think the problem arises because "the qsub command exits after returning the ID of the new job" and not after completing the task)