in reply to **HomeWork** Trying to search an array and match it to a user input

I, too, would suggest using grep, and reading the perlre and perlretut. I would also suggest that you make sure that your comparisons are case-insensitive, which can be done by adding the "i" flag to a regex or by using uc or lc on both sides of the string equality test, eq.

There is a number of alternatives to using an array, such as a dispatch tables, but I think they're overkill for this particular case.


emc

Information about American English usage here and here. Floating point issues? Please read this before posting.

  • Comment on Re: **HomeWork** Trying to search an array and match it to a user input