Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: How to create a "CONSTANT"

by kelan (Deacon)
on Jun 05, 2003 at 23:11 UTC ( #263546=note: print w/replies, xml ) Need Help??


in reply to How to create a "CONSTANT"

There's a pragma designed for constants. 'perldoc constant' for the manpage, but basically, it's like this:

use constant PIE => "Warm Apple"; print "pie: ", PIE, "\n";
Update: Fixed the typo from '=' to '=>' in the use line. Thanks merlyn.

kelan


Perl6 Grammar Student

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://263546]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2022-12-07 17:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?