in reply to Re: Recursive If statement not working.
in thread Recursive If statement not working.

Actually, the way that it is is correct, albeit it should be if ( (lc($autosubmit) ne "y") and (lc($autosubmit) ne "n") )

Truth tables:
p q ~p ~q p^q ~p v ~q ~( p ^ q ) T T F F T F F T F F T T F F F T T F T F F F F T T F T T
where p = lc($autosubmit) eq "y" and q = lc($autosubmit) eq "n" if $autosubmit is "Y", then p is True and q is false (lc("Y") = "y" but lc("Y") does not equal "n"), thus the statement as a whole is false and we do not enter the loop. The only time the loop is activated is if both conditions fail ( that is $autosubmit is neither "y" nor "n" ). Conversely (or contrapositively, whatever the term is - I forget), the same could be written as:
unless ( lc($autosubmit) eq "y" or lc($autosubmit) eq "n" )
shown above as ~(p ^ q)

Update: wow, I need to re-read - you come to the same conclusions, but it's just that the OP wants to bypass the "if" in that case (either y or n). So I posted truth tables in vain =) The issue here is that it will only be called once - on the first failure.