in reply to Looking Through Arrays?
#!/perl/bin/perl.exe -w use strict; my @AllowedRanks = ('Recruit', 'General', 'Captian', 'Civilian', 'Airm +an'); my $MemberCall = 'General'; foreach my $record (@AllowedRanks) { if("$MemberCall" eq $record) { &Welcome; } else { &NotWelcome; } } sub Welcome { print "Found a match\n"; } sub NotWelcome { print "No Match\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Looking Through Arrays?
by ACJavascript (Acolyte) on Dec 18, 2002 at 20:25 UTC |