in reply to Crazy constant question...

How about dualvar from Scalar::Util? This will allow you to assign both a number and a string to a scalar and you'll get the number back in numeric context and the string in string context. Sounds like it fulfills the requirements.