Sub::Current(3pm)

Sub::Current3pm

Get the current subroutine

Usage

    use Sub::Current;
    sub f {
        # ...
        if ($some_condition) {
            # let's recurse!
            ROUTINE->();
        }
        # ...
    }

Overview

Sub::Current makes available a function "ROUTINE()", that returns a code reference pointing at the currently executing subroutine.

In a special block (BEGIN, END, CHECK, INIT, and UNITCHECK in Perl 5.10) this function will return undef.

Outside of a special block (that is, at the top level of a program) "ROUTINE()" will return undef as well.

Releases

4 releases since Debian 6.0 (Squeeze); the text changed 3 times.

  1. 6.0
  2. 7
  3. 8
  4. 9

From libsub-current-perl 0.02-2+b3 in Debian 9 (Stretch). Parsed by carta from the page's man source.