in reply to inconsisntency, if, expect, logs

Change the || to &&. Your if will always be true with ||. Also, '/bin/sh' and "/bin/sh" are always the same. Read Quote and Quote-like operators in perlop to see when the kind of quote matters.

Update: Apparently I didn't make myself clear since y'all are still discussing the intricacies of Expect. The simple fact is that the logic in your if statement is wrong. Try this:

faulty_logic("fred"); faulty_logic("wilma"); faulty_logic("barney"); sub faulty_logic { my $input = shift; if (($input ne 'fred') || ($input ne 'barney')) { print "IF condition true: input=$input\n"; } } __END__ Output: IF condition true: input=fred IF condition true: input=wilma IF condition true: input=barney
Think about it.

Replies are listed 'Best First'.
Re: Re: inconsisntency, if, expect, logs
by waswas-fng (Curate) on Jun 13, 2003 at 19:47 UTC
    You are right about his if, however the if logic being wrong does not explain the newlines being placed in his expect log file. That is what i am after.

    -Waswas