We consider a number of constrained coding techniques that can be used to mitigate a nonlinear effect in the optical fiber channel that causes the formation of spurious pulses, called "ghost pulses". Specifically, if b/sub 1/b/sub 2/...b/sub n/ is a sequence of bits sent across an optical channel, such that b/sub k/=b/sub l/=b/sub m/=1 for some k,l,m (not necessarily all distinct) but b/sub k+l-m/=0, then the ghost-pulse effect causes b/sub k+l-m/ to change to 1, thereby creating an error. Such errors do not occur if the sequence of bits satisfies the following constraint: for all integers k,l,m such that b/sub k/=b/sub l/=b/sub m/=1, we have b/sub k+l-m/=1. We call this the binary ghost-pulse (BGP) constraint. We will show, however, that the BGP constraint has zero capacity, implying that sequences satisfying this constraint cannot carry much information. Consequently, we consider a more sophisticated coding scheme, which uses ternary sequences satisfying a certain ternary ghost-pulse (TGP) constraint. We further relax these constraints by ignoring interactions between symbols that are more than a certain distance t apart in the transmitted sequence. Analysis of the resulting BGP(t) and TGP(t) constraints shows that these have nonzero capacities, and furthermore, the TGP(t)-constrained codes can achieve rates that are significantly higher than those for the corresponding BGP(t) codes. We also discuss the design of encoders and decoders for coding into the BGP, BGP(t), and TGP(t) constraints.