We extend to positive real weights Haberlands formula giving a cohomological description of the Petersson scalar product of modular cusp forms of positive even weight. This relation is based on the cup product of an Eichler cocycle and a Knopp cocycle. We also consider the cup product of two Eichler cocycles attached to modular forms. In the classical context of integral weights at least $2$ this cup product is uninteresting. We show evidence that for real weights this cup product may very well be non-trivial. We approach the question whether the cup product is a non-trivial coinvariant by duality with a space of entire modular forms. Under suitable conditions on the weights this leads to an explicit triple integral involving three modular forms. We use this representation to study the cup product numerically.