Surely the point of the constant name is simply to alias the number? So whatever last_check()->{code} returns, you'll eventually compare it to CU_BAD_SYNTAX anyway?
If you want to store a meaningful name in the DB for other reasons, you could use a hash maybe, with nicer aliases than easy-to-spot-in-code ones - "Bad Syntax" etc.