Soliton perturbation theory is used to determine the evolution of a solitary wave described by a perturbed nonlinear Schrödinger equation. Perturbation terms, which model wide classes of physically relevant perturbations, are considered. An analytical solution is found for the first-order correction of the evolving solitary wave. This solution for the solitary wave tail is in integral form and an explicit expression is found, for large time. Singularity theory, usually used for combustion problems, is applied to the large time expression for the solitary wave tail. Analytical results are obtained, such as the parameter regions in which qualitatively different types of solitary wave tails occur, the location of zeros and the location and amplitude of peaks, in the solitary wave tail. Two examples, the near-continuum limit of a discrete NLS equation and an explicit numerical scheme for the NLS equation, are considered in detail. For the discrete NLS equation it is found that three qualitatively different types of solitary wave tail can occur, while for the explicit finite-difference scheme, only one type of solitary wave tail occurs. An excellent comparison between the perturbation solution and numerical simulations, for the solitary wave tail, is found for both examples.