$context{LeadingZero} = Parser::Context->getCopy("contextLimitedNumeric");should be
$context{LeadingZero} = Parser::Context->getCopy("LimitedNumeric");(no "context" in the name of the context). As you originally have it, you were asking for a non-existent context, and got a null return value. When you used it on the next line, perl complained about calling the flags method on an undefined reference.
Davide