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