} if ( $x =~ m/^Patient/ ) { print "matched here"; last WID; } } print "out of loop"; if ( $obj->has_members ) { dump_members($obj); } }