Use of Perl Reference

Google+ Pinterest LinkedIn Tumblr +

Main Use
With Perl, you can write a successful script without using any reference. However, when you want to economize the use of memory, you have to use a reference. Economizing memory here, means, you do not want the same large data in more than one location in memory. Reference, means the address of memory location that has some value. There are times when you need to know a value in a memory location and not the variable that is holding (identifying) the value.

As you can see, knowing how to use the reference makes you a better and efficient programmer. This knowledge also boosts your image. Understanding reference is usually one of the most difficult things in learning a language. Reference means the address of memory location that has some value, but you need to know how to apply that rule, under different circumstances, in program writing. Each language (e.g. Perl or PHP or C++) has its own way of applying this rule. In my opinion, the secret of learning reference, for any language, is to know how to apply the rule, in different circumstances. The actual hexadecimal address of the memory location is never typed in a program. So each language has its own way of going around that.

Object Oriented Programming in Perl
In a computer language, an object is an instance (unique occurrence) of a set of variables and functions that would work together. Perl does not have a formal way of producing objects. The reference is one of the main features used in producing objects in Perl. I will guide you to a simplified tutorial series on Object Oriented Programming in Perl, later.

Summary of the use of References in Perl
The main uses of Perl reference are, when you want to economize memory, when there is no need for you to know (use) variable of a value, and when producing objects.

Not already understood Perl Reference?
Maybe, you have not yet understood Perl Reference. If that is the case, then I believe I have already made the learning process simple, for you. I have written a step-by-step tutorial series on Perl References, expanding on the meaning of Reference and the way Perl (ActivePerl) applies the meaning. The formatting of the code samples is good, making the code samples very readable. There is no missing special character in the tutorials. In each page the links of the different parts of the tutorials are easily accessible.

If you already have basic knowledge in Perl, then click the following link to start learning Perl Reference:

http://www.broad-network.com/ChrysanthusForcha/Perl-Reference-to-a-Scalar.htm

Chrys

Share.

About Author

Leave A Reply