Forum Moderators: coopster & phranque

Message Too Old, No Replies

Searching 3 Arrays for an element.

How can i search three arrays then do something based on the specfic Array

         

zigx

8:58 pm on Apr 2, 2004 (gmt 0)

10+ Year Member



I have a user inputted value which is a number that will be in 1 of three arrays.

How should i structure this?

Basicalled the user will input a value, the script will search the three arrays and based on the array it will send an email to a specific address...

im NEW! =) thank you!

VectorJ

3:21 am on Apr 3, 2004 (gmt 0)

10+ Year Member



If the other two arrays will be empty you could just use something like:

if (scalar(@a)!= 0) {
mail('personA');
} elsif (scalar(@b)!= 0) {
mail('personB');
} elsif (scalar(@c)!= 0) {
mail ('personC');
} else {
throw_error();
}

But I'm not sure that I really understand what you're asking. Could you elaborate a bit?

I'm new too! :-)