#!/usr/bin/env perl use strict; use warnings; # Set an array of names my @names = qw/January February March April May June July August September October November December/; # Find the index number of next month my $next = (localtime)[4] + 1; # Loop over the next 12 months and print the month names in sequence for my $monpos ($next .. $next + 11) { print "Month is $names[$monpos % 12]\n"; }