In this paper, we present a perturbation method of solving a second-order difference equation with variable coefficients with some additional assumptions. This method can be used to devise an algorithmic solution for the moments of sojourn times in some processor sharing queues. In particular, we examine three queues. The first has exponential service and a fairly general interrupted arrival mechanism. The second is a cyclic queue. The third is a model for a computer system in which finite and infinite sources interact.