Your full service technology partner! 
-Collapse +Expand
To/From Code
   ► KBTo/From GuidesReferencePerlLanguage Basics  Print This     

Perl Language Basics


General Info: Computer Language Constants

A constant is just like a variable (it holds a value) but, unlike a variable, you cannot change the value of a constant.

Perl:   use constant

In 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

Definition:  Computer Language Constants

Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site:

©1995-2024 Prestwood IT Solutions.   [Security & Privacy]