このスクリプトを見て、考えられる解決策を提案してください。
my $otext = 'ABCDEABCDEABCDEABCDEABCDE';
my $len = length($otext);
print "length of string is:\n".$len;
$n = 1;
if ($n == 1) {
if (substr($otext, -1, 1) eq "E") {
if ($len >= 3) {
if ($len == 3) {
$len1 = 2 * $len - 1;
$len2 = 3 * $len - 2;
}
else {
$len1 = 2*$len-1;
$len2 = 3*$len-3;
}
}
else {
$len1 = 0;
$len2 = 0;
}
print "Length-1 is:". $len1;
print "Length-2 is:" .$len2;
}
}
else {
print "\n It's else loop ";
}