constant variable in perl

A

Alexander Jack

How to declare and use a constant variable in Perl ,
please help me out ,

thanx in Advance .
 
N

News123

Hi ALex,

As so often.

Perldoc would be your friend.
or if you prefer web front ends
(go to http://perldoc.perl.org/ and enter constant in the search field)

How to declare and use a constant variable in Perl ,
please help me out ,

There's multiple option:

the one directly documented in the perl onine documentation can be seen with


perldoc constant
 
A

Alexander Jack

Hi ALex,

As so often.

Perldoc would be your friend.
or if you prefer web front ends
(go tohttp://perldoc.perl.org/and enter constant in the search field)


There's multiple option:

the one directly documented in the perl onine documentation can be seen with

perldoc constant

Thank you news
 
A

Alexander Jack

use constant NAME => "value";

or

use Readonly;
Readonly my $var = "value";

depending on which you prefer.

Ben

Don't think that I am too greedy , but I want to know what is the
difference between constant and Readonly in perl .
 
A

Alexander Jack

use constant NAME => "value";

or

use Readonly;
Readonly my $var = "value";

depending on which you prefer.

Ben

I didn't find any pragma like Readonly in my system , Can you tell me
how to get this...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top