  We study the complete gravitational collapse of a class of spherically
symmetric inhomogeneous perfect fluid models obtained by introducing small
radial perturbations in an otherwise homogeneous matter cloud. Our aim here is
to study the genericity and stability of the formation of black holes and
locally naked singularities in collapse. While the occurrence of naked
singularities is known for many models of collapse, the key issue now in focus
is genericity and stability of these outcomes. Towards this purpose, we study
how the introduction of a somewhat general class of small inhomogeneities in
homogeneous collapse leading to a black hole can change the final outcome to a
naked singularity. The key feature that we assume for the perturbation profile
is that of a mass profile that is separable in radial and temporal coordinates.
The known models of dust and homogeneous perfect fluid collapse can be obtained
from this choice of the mass profile as special cases. This choice is very
general and physically well motivated and we show that this class of collapse
models leads to the formation of a naked singularity as the final state.
