On Mon, 23 Dec 2002 02:10:17 -0600, [EMAIL PROTECTED] (David
Gilden) wrote:

>This is not working either!!!!
>
># Goal, to check against two different passwords.
>
>#!/usr/bin/perl 
>my $qs = 'c';
>my $secret_word  = 'a';
>my $secret_word_guest  = 'b';
>
>if ($qs !~ /$secret_word_guest|$secret_word/) {
>print "fail\n"; 
>} else { print "go, ok\n";}
>
>... more code...
>
>
>What should happen is that if $secret_word OR $secret_word_guest does not Match $qs 
>Then it should print 'Fail'.
>
>Please see if you can explain  why this in not working,

It works exactly as you wrote it.

You are telling it "if c does not match a or b" print fail.

Try putting $qs = 'a'   it works fine.
Logic will get you twisted into a pretzel. :-)


Maybe you want
print "fail\n" unless ($qs =~ /$secret_word_guest|$secret_word/);





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to