in reply to Looking Through Arrays?
@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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Looking Through Arrays?
by chromatic (Archbishop) on Dec 18, 2002 at 05:15 UTC |