https://blog.ysth.info/idiomatic-perl-solutions-to-the-weekly-challenge-325-task-1/