smackdab has asked for the wisdom of the Perl Monks concerning the following question:
From PerlDoc:
"Symbols are package scoped. That is, you can refer to a constant in package Other as Other::CONST."
I defined:
I saw a web site mention using "my", so I tried:
"Symbols are package scoped. That is, you can refer to a constant in package Other as Other::CONST."
I defined:
use constant CFGDIR=>'/config/' in my main script
This didn't work for me. I switched it to a $variable, which did work, so I don't think it is a typo...Then tried to refer to it from module1.pm, $c = main::CFGDIR
I saw a web site mention using "my", so I tried:
thanks for any suggestionsmy constant CFGDIR=>'/config/' our constant CFGDIR=>'/config/'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: question on constants
by wog (Curate) on Jan 01, 2002 at 09:16 UTC | |
by smackdab (Pilgrim) on Jan 01, 2002 at 09:41 UTC |
Back to
Seekers of Perl Wisdom