Monday, December 21, 2009

Perl Programming

Perl is a programming language which can be used for a large variety of tasks.
Programs written in Perl are called Perl scripts, whereas the term the perl program refers to the system program named perl for executing Perl scripts.


There is a lot to learn in perl, but here I will mention only few items.

Data Types in Perl: scalars, arrays, associative arrays are some of the main data types.

Scalars: are used to store single value, or a string, and they are prefixed with $ sign. Perl doesn't differentiate between integers and floats like C does.

$price=25.6;
$name="Gaurav Gupta"

Array: It is similar to array in C/C++. It's generally called list in perl. It contains many scalar variables in form of list. It is prefixed with @ sign
@name=("gaurav", "kumar", "gupta", "5")

Associative array in perl is called as HASH, it's basically pairs of arrays

No comments:

Post a Comment