VARIABLES, DATA, AND OBJECTS

Within Perl we have a number of distinct variable types, starting with the basic scalar and moving up through the array of scalars (or just simply an array) to the hash (or associative array of scalars). There are some other basic types such as the filehandle (which has now largely been replaced by IO::Handle) and the all encompassing typeglob.

Objects are created by using a reference to one of the base data types and then using the bless function to associate the reference with a particular package (and therefore by association into a particular class).

Perl uses a large number of operators and functions in order to support the base data types. Many of these are compatible with the different base types, but operations ...

Get Perl To Python Migration now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.