in reply to Issue with unless statement with two conditions acting on two lines
Have you inspected/printed out the values of $previous_line and $current_line while your program goes through the loop?