Re: check against two different passwords.

2002-12-23 Thread Rob Dixon
Nearly, but it needs to be: if ( $qs ne $secret_word_guest and $qs ne $secret_word ) ^^^ or consider unless (grep $qs eq $_, ($secret_word, $secret_word_guest) ) { : } Cheers, Rob "John W. Krahn" <[EMAIL PROTECTED]> wrote in message [

Re: check against two different passwords.

2002-12-23 Thread John W. Krahn
David Gilden wrote: > > Hello, Hello, > in the following > > # Goal: 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/) { You need boundaries for an exact matc

RE: check against two different passwords.

2002-12-23 Thread Timothy Johnson
How about this: if ($qs !~ /($secret_word_guest|$secret_word)/) { or if ($qs ne $secret_word_guest && $qs ne $secret_word_guest) { -Original Message- From: David Gilden [mailto:[EMAIL PROTECTED]] Sent: Monday, December 23, 2002 9:15 AM To: [EMAIL PROTECTED] Subject: check against two