Perl Weekly Challenge 184: Sequence Number and Split Array
These are some answers to the Week 184 of the Perl Weekly Challenge organized by Mohammad S. Anwar.
Spoiler Alert: This weekly challenge deadline is due in a couple of days from now (on Oct. 2, 2022 at 23:59). This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own.
Task 1: Sequence Number
You are given list of strings in the format aa9999 i.e. first 2 characters can be anything ‘a-z’ followed by 4 digits ‘0-9’.
Write a script to replace the first two characters with sequence starting with ‘00’, ‘01’, ‘02’ etc.
Example 1
Input: @list = ( 'ab1234', 'cd5678', 'ef1342')
Output: ('001234', '015678', '021342')
Example 2
Input: @list = ( 'pq1122', 'rs3334')
Output: ('001122', '013334')


