in reply to Reference to an anon sub from within.

In your first example, the sub presumably returns something printable. In the second, the print is inside the sub. The two examples behave the same. Yes, you can dereference the sub in the same line you declare it.

Caution: Contents may have been coded under pressure.
  • Comment on Re: Reference to an anon sub from within.