Types of References II

Learn about some more types of references in Perl.

Function references

Perl supports first-class functions; a function is a data type like an array or hash. In other words, Perl supports function references. This enables many advanced features like closuresA closure is a function that uses lexical variables from an outer scope.. We can create a function reference by using the reference operator and the function sigil & on the name of a function:

Access this course and 1400+ top-rated courses and projects.