A constant is just like a variable (it holds a value) but, unlike a variable, you cannot change the value of a constant.
Perl ConstantsIn Perl, you declare constants using the use constant keywords: use constant CONST_NAME => "Value";
Constants in Perl are case sensitive. A common standard in Perl is to use all-uppercase letters, with underscores to separate words within the name.
Syntax Example: use constant FULL_NAME => 'Mike Prestwood'; use constant AGE => 38; print "Your name is " . FULL_NAME . ".<br>"; print "You are " . AGE . ".<br>";
More Info
0 Comments.
Would you like to comment? Reply? Ask a question? Say thanks?
| KB Article #102184 Counter |
| 144 |
|
Since 7/15/2010
|
|
|
|