https://fluca1978.github.io/2022/05/18/PerlWeeklyChallenge165.html#task1plperl