The perturbed Riemann problem for a balance law