Posts

Showing posts from November, 2025

Robbie Hatley's Solutions, in Perl, for The Weekly Challenge #347 (“Format Date” and “Format Phone”)

Image
For those not familiar with "The Weekly Challenge", it is a weekly programming puzzle with two parts, with a new pair of tasks each Monday. You can find it here: The Weekly Challenge The Weekly Challenge for the week of 2025-11-10 through 2025-11-16 is #347. The tasks for challenge #347 are as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Task 347-1: Format Date Submitted by: Mohammad Sajid Anwar You are given a date in the form: 10th Nov 2025. Write a script to format the given date in the form: 2025-11-10 using the set below: @DAYS = ("1st", "2nd", "3rd", ....., "30th", "31st") @MONTHS = ("Jan", "Feb", "Mar", ....., "Nov", "Dec") @YEARS = (1900..2100) Example #1: Input: "1st Jan 2025" Output: "2025-01-01" Example #2: Input: "22nd Feb 2025" Output: "2025-02-22" Example #3: Input: "15th Apr...