I.T. Discussion Community!
-Collapse +Expand
Perl
Search Perl Group:

Advanced
-Collapse +Expand Perl To/From
To/FromCODEGuides
-Collapse +Expand Perl Store
PRESTWOODSTORE

Prestwood eMagazine

November Edition
Subscribe now! It's Free!
Enter your email:

   ► KBWebsite Scri...Perl   Print This     
  From the June 2013 Issue of Prestwood eMag
 
Perl Constants (use constant)
 
Posted 9 years ago on 7/15/2010
Perl Code Snippet:
 A flashcard from our Perl Flashcards Library
 A code snippet from our Perl Code Snippets Page
 Tags: Perl , Constants

KB102184

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 Constants

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

Comments

0 Comments.
Share a thought or comment...
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1134A1
Enter key:
Code Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile

 KB Article #102184 Counter
9998
Since 7/15/2010

Follow PrestwoodBoards on: 


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech