in reply to Use hash variable as constant

Ok i think i figured it out after reading a lot more.
Please correct me if i am wrong.
Constants are like subroutines?!
So even though i can't access the value directly i can get them via eval.

so i added:
my $typeValue = eval("$type()");
and now i am using $typeValue rather than $type itself.

Is my understanding of this issue correct?

thanks Mike

Replies are listed 'Best First'.
Re^2: Use hash variable as constant
by kcott (Archbishop) on Jun 27, 2014 at 16:21 UTC
    "Is my understanding of this issue correct?"

    Short answer: I suspect not.

    Longer answer:

    Are you talking about the constant pragma? If so, read the doco: you seem to have some (partly) correct, as well as wrong, ideas about this.

    If you're referring to something else, please specify.

    -- Ken