I've just noticed that the debugging line I added (warn longmess...)
actually stops the recursion (though in a larger module in which I
first encountered the bug, it doesn't). If I delete it, I get the
following warning:
Deep recursion on anonymous subroutine at overtest line 10.
Line 10 is the line with the substitution.