%hash = abbrev (split(':', "Baltimore:Chicago:Los Angeles:New York:San Diego:"));
chomp (my $input_city = <STDIN> );
if (exists $hash{$input_city}) { ...... }
In reply to Re^2: **HomeWork** Trying to search an array and match it to a user input
by Arif
in thread **HomeWork** Trying to search an array and match it to a user input
by trenchwar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |