You really haven't given us enough information as to how you are *using* these values. Normally you would want to
keep even octal numbers in numeric form and convert them
when you store or display to whatever format you want.
You can preserve e.g. octal string form but have it come out as the correct number in a decimal context with:
use Scalar::Util "dualvar";
use constant Foo => dualvar(0040,"0040");