in reply to compilation error on 5.8 with $^V gt 'v5.10.0'
Use eval to avoid parsing too-recent code at compile time.
Or just avoid using smartmatch entirely, of course. This is the way I would choose.