|
Problem:
You want to use a subroutine as if it were an object. Solution:
Make sure you use the '
Discussion: Typically, including a subroutine name in a statement calls that subroutine, returning a value: simply saying
therefore calls mysub first, then calls the foo method on whatever value mysub returned. Most of the time this is what you want.
If you want to perform a method call on the subroutine object itself, and not on the value the subroutine will return, you need to specify the full name of the subroutine, including the initial '
See later recipes for the methods available on a subroutine.
|