if $autoSubmit='Y'", the first clause of the AND statement is 'true' and the second clause is 'false'. The result of 'true' AND 'false' is 'false' and the control bypasses the if-block. Same argument applies for 'N' as well. Use OR logic for this.
or use
Note: You can also us a while loop and get rid of the "subroutine" call.return(lc $autoSubmit) if (lc $autoSubmit eq 'y'); return(lc $autoSubmit) if (lc $autoSubmit eq 'n'); autoSubmit();
----
I Go Back to Sleep, Now.
OGB
In reply to Re: Recursive If statement not working.
by Old_Gray_Bear
in thread Recursive If statement not working.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |