my $months = 'AugAugAugAugAugAugAugAugAugAugAugAug'; my $month = 8; printf '%s', substr($months, $month*3, 3); #### my $month = 8; printf '%s', substr('Aug'x12, $month*3, 3);