I am obviously not welcomed :-) Your first line did give you a syntax error, didn't it? Other problems, which the compiler will not tell you, are the following:
- The quots surrounding $MemberCall and $i are not neccessary, although they do not cause problem in your case.
- if you set $found to "1", then you can not use == later, == is for numbers.
@AllowedRanks = ("Recruit","General","Captian","Civilian","Airman");
$found=0;
my $MemberCall = "me";
foreach $i (@AllowedRanks){
if($MemberCall eq $i){
$found=1;
}
}
if($found==1){
&Welcome;
}else{
&NotWelcome;
}
sub Welcome {
print "welcome\n";
}
sub NotWelcome {
print "Notwelcome\n";
}