in reply to Re: **HomeWork** Printing the found input from an array
in thread **HomeWork** Printing the found input from an array

toolic's point is well taken, but that "fix" is only partial. If, at runtime, one enters 0 for the month number, we see this:
Enter the month as an integer i.e. (1=January, 2=Febuary, etc.) 0 How many days [1-31]? 31 Hi Steve, I'm looking forward to the Perl class. I just want to let you know that I won't be in class on the following +days: December 1, 2, 3, 4, 5, 6, 7, ....
So one still needs to test another element of validity in the input:
chomp(my $month = <STDIN> ); $month--; print "Invalid Month $month specified\n" unless (exists $months[$month +]); unless (exists $months[$month] && ( $month >=0 && $month <= 11 ) ){ print" Quitting. Insufficient user IQ or typing skills\n"; exit; }

And, similarly with the day_of_month entry.

Further, looking back to OP's test for cities, telling the user that only a restricted list is acceptable is fine, but if the user ignores that, and enters, say, ( Livonia || Las Vegas || Los Gatos ),that user still gets an answer (clear enough here, but perhaps not in a more complicated scenario) which refers only to Los Angeles, and thus may fail to help the (inattentive) luser understand what's wrong.

Undoubtedly outside the scope of this particular bit of homework, but worth thinking about: Checking for invalid input and providing feedback are highly desireable and designing checks with broad coverage may require a lot of thought about how the user could "screw things up."