in reply to And plus OR

Instead of the || (or), you need && (and) in your if statement. If I understand you correctly, you want to do the "if" as long as the $username is ok, except if the $type is either of 2 conditions. Edit: I guess in other words, you want to do the "if" if the $username is ok and $type="Something Else";.
#!usr/bin/perl use strict; use warnings; my $security = "xxx"; my $username = "xxx"; my $type = "Check In"; if ($username eq "$security" and $type ne "Check In" and $type ne "Che +ck Out" ) { print "if executed, username=$username type=$type\n"; } else { print "if not executed, username=$username type=$type\n"; } __END__ if not executed, username=xxx type=Check In *** This is the same thing:*** if (($username eq "$security") and !( $type eq "Check In" or $type eq +"Check Out") )
I show 2 different version of the "if", both do the same thing. This is called DeMorgan's theorem. Note that the "ne" becomes "eq" in the second version. I like the first version better, but your call... they are the same logically.