I thought of that. However, I was hoping for something less verbose. I suppose as kernelm says, I could wrap that in a subroutine (returning a boolean ) and then call it as if it were a built-in function. I suppose having used PHP for so long now, going back to Perl feels like too much work.
Yes, a hash really is better in this case. Funny I didn't think of it because I've used three other hashes in this program so far. Grr. Argh!
BTW, major points for making your example use Whedonverse content. Shouldn't all programming examples work this way? ;-)
sub buffyBotSubRoutine_boolean001 {
# Are we allowed to pass a whole
# array as a param?
my @nest = shift;
my $wanted = "Spike";;
foreach my $vampire (@nest) {
if ($vampire eq $wanted) {
buffyBotSubRoutine_shagHim($vampire);
} else {
buffyBotSubRoutine_stakeHim($vampire);
}
}
}
(no subject)
Date: 2005-08-11 08:44 pm (UTC)(no subject)
Date: 2005-08-11 08:49 pm (UTC)(no subject)
Date: 2005-08-11 09:14 pm (UTC)BTW, major points for making your example use Whedonverse content. Shouldn't all programming examples work this way? ;-)