in reply to Looking Through Arrays?

It's a good idea to 'use strict', and to turn on the warnings flag
#!/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
    Thank you all so very much!

    it works now! :)