Example programs for Part 21

Because IE will not transmit files with extension '.pl', all example Perl files are stored without extension. Be sure to add the '.pl' extension (or change the '.txt' extension to '.pl') and choose All Files for Save type as: when you save these Perl files in your local folder.

Example of multiple return values, from sec. 21.1

Example of returning an array in a scalar context from sec. 21.1

The program illustrating my variables, from sec. 21.2.1

The program with the swap function, from sec. 21.3

The program illustrating pass by value, from sec. 21.3.1

The program illustrating pass by reference, from sec. 21.3.2

Example that finds the people with the top five salaries, from sec. 21.3.3

Sorting a hash on its keys and on its values, from sec. 21.4