  Submillimeter lines of CN, NO, CO+ and SO+, and upper limits on SH+ and N2O
are observed with the James Clerk Maxwell Telescope in two high-mass and up to
nine low-mass young stellar objects and compared with chemical models. Constant
fractional abundances derived from radiative transfer modeling of the line
strengths are x(CN) ~ a few x 10^{-11}-10^{-8}, x(NO) ~ 10^{-9}-10^{-8} and
x(CO+) ~ 10^{-12}-10^{-10}. SO+ has abundances of a few x 10^{-11} in the
high-mass objects and upper limits of ~ 10^{-12}-10^{-11} in the low-mass
sources. All abundances are up to 1-2 orders of magnitude higher if the
molecular emission is assumed to originate mainly from the inner region (< 1000
AU) of the envelope. For high-mass sources, the CN, SO+ and CO+ abundances and
abundance ratios are best explained by an enhanced far-ultraviolet (FUV) field
impacting gas at temperatures of a few hundred K. The observed column densities
require that this region of enhanced FUV has scales comparable to the observing
beam, such as in a geometry in which the enhanced FUV irradiates outflow walls.
For low-mass sources, the required temperatures within the FUV models of T >
300 K are much higher than found in models, so that an X-ray enhanced region
close to the protostar (r < 500 AU) is more plausible. The observed abundances
imply X-ray fluxes for the Class 0 objects of L_X ~ 10^{29}-10^{31} erg s^{-1},
comparable to those observed from low-mass Class I protostars. Spatially
resolved data are needed to clearly distinguish the effects of FUV and X-rays
for individual species.
