-
-
30 Jan 2017 16:05:06 UTC
- Distribution: Sub-Current
- Module version: 0.03
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues (3)
- Testers (2345 / 0 / 1)
- Kwalitee
Bus factor: 0- 100.00% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (3.69KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- unknown
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Sub::Current - Get the current subroutine
SYNOPSIS
use Sub::Current; sub f { # ... if ($some_condition) { # let's recurse! ROUTINE->(); } # ... }
DESCRIPTION
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.Note: on perl 5.16.0 and later you can use the built-in
__SUB__
instead, enabled by the pragmause feature 'current_sub'
.SOURCE
A repository for the sources is at https://github.com/rgs/p5-Sub-Current.
COPYRIGHT
(c) Copyright 2007, 2017 by Rafael Garcia-Suarez.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install Sub::Current, copy and paste the appropriate command in to your terminal.
cpanm Sub::Current
perl -MCPAN -e shell install Sub::Current
For more information on module installation, please visit the detailed CPAN module installation guide.