#!/usr/unsupported/bin/perl

$printme=1;

@thispr=();
while(<>) {
    push(thispr,$_);
    $printme = 0 if(/>State: *closed/);
    if(/^\n$/) {
	if ($printme) {
	    for(@thispr) { print; }
	} else {
	    $printme = 1;
	}
	@thispr=();
    }
}
