  We study singular real-analytic Levi-flat hypersurfaces in complex projective
space. We define the rank of an algebraic Levi-flat hypersurface and study the
connections between rank, degree, and the type and size of the singularity. In
particular, we study degenerate singularities of algebraic Levi-flat
hypersurfaces. We then give necessary and sufficient conditions for a Levi-flat
hypersurface to be a pullback of a real-analytic curve in $\mathbb{C}$ via a
meromorphic function. Among other examples, we construct a nonalgebraic
semianalytic Levi-flat hypersurface with compact leaves that is a perturbation
of an algebraic Levi-flat variety.
