in reply to Reducing repetitive code

Perhaps the following will help you for the bigger picture you are trying to solve:

use DateTime; $dt = DateTime->now; $month_name = $dt->month_name;
It prints full names of month as you desired.