my $currentperiod = 'P08'; print "\nCurrent Period is (LE period is current period incremented by one): ". $currentperiod; # next twelve if are used to increment current period by one if ($currentperiod eq 'P01') { my $LEperiod = 'P02'; } if ($currentperiod eq 'P02') { my $LEperiod = 'P03'; } if ($currentperiod eq 'P03') { my $LEperiod = 'P04'; } if ($currentperiod eq 'P04') { my $LEperiod = 'P05'; } if ($currentperiod eq 'P05') { my $LEperiod = 'P06'; } if ($currentperiod eq 'P06') { my $LEperiod = 'P07'; } if ($currentperiod eq 'P07') { $LEperiod = 'P08'; } if ($currentperiod eq 'P08') { $LEperiod =~ 'P09'; } if ($currentperiod eq 'P09') { my $LEperiod = 'P10'; } if ($currentperiod eq 'P10') { my $LEperiod = 'P11'; } if ($currentperiod eq 'P11') { my $LEperiod = 'P12'; } if ($currentperiod eq 'P12') { my $LEperiod = 'P01'; } print "\nCurrent Period after ifs is: ". $currentperiod; $LEperiod ="xxxx"; print "\nDefault LE period is : " . $LEperiod . "\n\n";