In this paper, we first establish some refinements of the weighted generalized trapezoid inequality for functions of bounded variation in terms of a cumulative variation function, and then obtain some perturbed versions of the weighted generalized trapezoid inequality. Several applications for selfadjoint operators on complex Hilbert spaces are also given.