Session
The Identity Function
Mark-Jason Dominus, Chief Programmer, Plover Systems Co.
Track: Perl Conference 5
Date: Wednesday, July 25
Time: 11:30am
- 12:15pm
Location: Grande Ballroom B
The identity function:
and its variations:
- sub identity { $_[1] }
- sub identity { @_ }
are more useful than they appear. I will show at least three surprising and unexpected uses for the identity function, in the style of my "Perl Hardware Store" and "Tricks of the Wizards" talks of past years.
The identity functions I'll discuss may include:
- The identity function to emulate the C address-of operator
- The identity function to perform method calls in double-quoted strings
- The identity function to accumulate a list of all the broken symlinks under a directory or its subdirectories
- The identity function to reconnect a tied variable with its object
- Other surprising appearances of the identity function