in reply to Recursive If statement not working.
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Recursive If statement not working.
by Transient (Hermit) on Jun 25, 2009 at 19:49 UTC |