diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-11-21 23:43:17 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-11-22 00:07:20 -0800 |
commit | 84ed01088568ffe9cf49047f10500ca511db0c9e (patch) | |
tree | 614defca700a49e07194fa9e5b177120fc2ba50b /pod/perldata.pod | |
parent | 8f84cc86e11f13b85c64fd0205261e12bef9e7f9 (diff) | |
download | perl-84ed01088568ffe9cf49047f10500ca511db0c9e.tar.gz |
[perl #80628] __SUB__
After much alternation, altercation and alteration, __SUB__ is
finally here.
Diffstat (limited to 'pod/perldata.pod')
-rw-r--r-- | pod/perldata.pod | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pod/perldata.pod b/pod/perldata.pod index 7899e396e0..16ceb41048 100644 --- a/pod/perldata.pod +++ b/pod/perldata.pod @@ -398,12 +398,16 @@ X<end> X<data> X<^D> X<^Z> The special literals __FILE__, __LINE__, and __PACKAGE__ represent the current filename, line number, and package name at that -point in your program. They may be used only as separate tokens; they +point in your program. __SUB__ gives a reference to the current +subroutine. They may be used only as separate tokens; they will not be interpolated into strings. If there is no current package (due to an empty C<package;> directive), __PACKAGE__ is the undefined value. (But the empty C<package;> is no longer supported, as of version -5.10.) -X<__FILE__> X<__LINE__> X<__PACKAGE__> X<line> X<file> X<package> +5.10.) Outside of a subroutine, __SUB__ is the undefined value. __SUB__ +is only available in 5.16 or higher, and only with a C<use v5.16> or +C<use feature "current_sub"> declaration. +X<__FILE__> X<__LINE__> X<__PACKAGE__> X<__SUB__> +X<line> X<file> X<package> The two control characters ^D and ^Z, and the tokens __END__ and __DATA__ may be used to indicate the logical end of the script before the actual |