print #handle, "discard"

This causes all drawn items since the last flush to be discarded (this also reclaims memory used by the discarded drawn items).  Discard does not force an immediate redraw, so the items that have been discarded will still be displayed until a redraw (see redraw).