in reply to How can I declare constants?
If you don't mind that it can be changed, you can simply declare your constants as follows:
# Constants used throughout the program: my $number_of_pages = 3;
If you are really paranoid and don't want your constants to be changeable, use the constant pragma:
use constant NUMBER_OF_PAGES => 3;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How can I declare constants?
by Anonymous Monk on Oct 05, 2005 at 11:25 UTC | |
by reasonablekeith (Deacon) on Oct 05, 2005 at 11:28 UTC | |
by Corion (Patriarch) on Oct 05, 2005 at 11:29 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |