10 Einträge, 1 Seite |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
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";
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
my $currentperiod = 'P08'; print "\nCurrent Period is (LE period is current period incremented by one): ". $currentperiod; my $LEperiod = 'xxxxx'; # next twelve if are used to increment current period by one if ($currentperiod eq 'P01') { $LEperiod = 'P02'; } elsif ($currentperiod eq 'P02') { $LEperiod = 'P03'; } #... die anderen elsifs elsif ($currentperiod eq 'P12') { $LEperiod = 'P01'; } print "\nCurrent Period after ifs is: ". $currentperiod; print "\nDefault LE period is : " . $LEperiod . "\n\n";
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
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";
1 2 3 4 5 6 7 8 9
my $currentperiod = 'P12'; print "\nCurrent Period is (LE period is current period incremented by one): ". $currentperiod; my $LEperiod = $currentperiod; ++$LEperiod; $LEperiod = 'P01' if $LEperiod eq 'P13'; print "\nCurrent Period after ifs is: ". $currentperiod; print "\nDefault LE period is : " . $LEperiod . "\n\n";
1 2 3
my $LEperiod = "P12"; $LEperiod = 'P01' if ++$LEperiod eq 'P13'; print $LEperiod'
10 Einträge, 1 Seite |