--- Michael Kelly <[EMAIL PROTECTED]> wrote:
> Only and's short-circuit. Or's test every argument by necessity.
Mike,
In just about every Perl script that has to read from or write to a
file, you will see a line similar to the following:
open (MYFILE, "myfile.txt") or die "Can't open myfile.tx
"David Gilden" <[EMAIL PROTECTED]> wrote in message
news:r01050400-1023-E78ABED6164811D78F0D0003935B6868@[192.168.1.5]...
> Holiday greetings,
>
> I would like to be able to test for either of the two secret words
> but it seems to fail, what am I missing?
> Thanks
> Dave
>
>
> #!/usr/bin/perl
>
On Mon, Dec 23, 2002 at 10:35:59AM -0600, David Gilden wrote:
> PERL 5.6
> OSX, Jaguar
>
> Goal, to check against two different passwords.
>
>
> I think my problem is the "or" is short 'circuited'
> is there a way for an IF statement to test for both
> values, so that either $secret_word or $
PERL 5.6
OSX, Jaguar
Goal, to check against two different passwords.
I think my problem is the "or" is short 'circuited'
is there a way for an IF statement to test for both
values, so that either $secret_word or $secret_word_guest
will be tested, (I am not looking for AND)
What should happ
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
On Mon, 23 Dec 2002 01:33:58 -0600, [EMAIL PROTECTED] (David
Gilden) wrote:
>I would like to be able to test for either of the two secret words
>but it seems to fail, what am I missing?
>#!/usr/bin/perl
>use CGI qw/:standard/;
>use CGI::Carp qw(fatalsToBrowser);
>use strict;
>
>my $qs = $ENV{'Q
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 happe
Holiday greetings,
I would like to be able to test for either of the two secret words
but it seems to fail, what am I missing?
Thanks
Dave
#!/usr/bin/perl
use CGI qw/:standard/;
use CGI::Carp qw(fatalsToBrowser);
use strict;
my $qs = $ENV{'QUERY_STRING'};
my $secret_word = 'one';
my $secret