I’ve a problem in an if-block. I’m comparing two variables, if they are equal then some statements should be executed otherwise some other statement should be executed. I need to return new statement if my false block is executed second time.
For example:
if($type eq $kind ){
$line1 .= "</p></list-item>\n<list-item><p>";
}
else{
$line1 .= "\n<list list-type=\"$kind\">\n<list-item><p>";
}
Here type=bullet and kind=number, now the second time the else part (again kind=number) is executed, I want to show the same statement assigned to the $line, I want to show like <list-item></p>
Where do I check the condition again?
You need to keep some state, and use that to determine what to print out the second (or third, or…) time around.