my $currentperiod = 'P08'; print "\nCurrent Period is (LE period is current period incremented by one): ". $currentperiod; my $LEperiod = 'xxxxx'; my %hash = ( P01 => 'P02', P02 => 'P03', P03 => 'P04', P04 => 'P05', P05 => 'P06', P06 => 'P07', P07 => 'P08', P08 => 'P09', P09 => 'P10', P10 => 'P11', P11 => 'P12', P12 => 'P01', ); if( exists $hash{ $currentperiod } ){ $LEperiod = $hash{$currentperiod}; } print "\nCurrent Period after ifs is: ". $currentperiod; print "\nDefault LE period is : " . $LEperiod . "\n\n";