Types of References II

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:

Get hands-on with 1200+ tech skills courses.