Menu Close

What is a Perl module?

What is a Perl module?

A Perl module is a reusable collection of related variables and subroutines that perform a set of programming tasks. There are a lot of Perl modules available on the Comprehensive Perl Archive Network (CPAN). You can find various modules in a wide range of categories such as network, XML processing, CGI, databases interfacing, etc.

What are the types of variables in Perl?

Perl – Variables 1 Creating Variables. Perl variables do not have to be explicitly declared to reserve memory space. 2 Scalar Variables. A scalar is a single unit of data. 3 Array Variables. An array is a variable that stores an ordered list of scalar values. 4 Hash Variables. A hash is a set of key/value pairs.

Are variables in Perl case-sensitive?

Variables in Perl are case-sensitive. It starts with $, @ or % as per the datatype required, followed by zero or more letters, underscores, and digits Variables in Perl cannot contain white spaces or any other special character except underscore.

What is the difference between scalar and array in Perl?

Perl – Variables. A scalar variable will precede by a dollar sign ($) and it can store either a number, a string, or a reference. An array variable will precede by sign @ and it will store ordered lists of scalars. Finaly, the Hash variable will precede by sign % and will be used to store sets of key/value pairs.

Posted in Blog