PaxHeader/Sub-Current-0.03000755 777777 777777 00000000214 13043661717 020573 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 23 SCHILY.dev=16777220 23 SCHILY.ino=75817057 19 SCHILY.nlink=10 Sub-Current-0.03/000755 €^—³€)—Ue00000000000 13043661717 017436 5ustar00rgarciaCORPAD\Domain Users000000 000000 Sub-Current-0.03/PaxHeader/Changes000644 777777 777777 00000000213 13043661611 022130 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 23 SCHILY.dev=16777220 23 SCHILY.ino=75816928 18 SCHILY.nlink=2 Sub-Current-0.03/Changes000644 €^—³€)—Ue00000000270 13043661611 020721 0ustar00rgarciaCORPAD\Domain Users000000 000000 0.03 - Mon Jan 30 2017 Fix a crash when run under the debugger (Mattia Barbon) 0.02 - Wed Jul 4 2007 More tests. Require 5.8.x. 0.01 - Tue Jul 3 2007 Initial release Sub-Current-0.03/PaxHeader/Current.xs000644 777777 777777 00000000213 13043660346 022637 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 23 SCHILY.dev=16777220 23 SCHILY.ino=75816419 18 SCHILY.nlink=2 Sub-Current-0.03/Current.xs000644 €^—³€)—Ue00000000502 13043660346 021426 0ustar00rgarciaCORPAD\Domain Users000000 000000 #include "EXTERN.h" #include "perl.h" #include "XSUB.h" MODULE = Sub::Current PACKAGE = Sub::Current PROTOTYPES: ENABLE SV * ROUTINE() PREINIT: CV *cv; U32 dummy; CODE: cv = Perl_find_runcv(aTHX_ &dummy); if (CvUNIQUE(cv)) RETVAL = &PL_sv_undef; else RETVAL = newRV((SV*)cv); OUTPUT: RETVAL Sub-Current-0.03/PaxHeader/lib000755 777777 777777 00000000213 13043661717 021340 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 23 SCHILY.dev=16777220 23 SCHILY.ino=75817068 18 SCHILY.nlink=3 Sub-Current-0.03/lib/000755 €^—³€)—Ue00000000000 13043661717 020204 5ustar00rgarciaCORPAD\Domain Users000000 000000 Sub-Current-0.03/PaxHeader/Makefile.PL000644 777777 777777 00000000213 13043661104 022604 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 23 SCHILY.dev=16777220 23 SCHILY.ino=75816691 18 SCHILY.nlink=2 Sub-Current-0.03/Makefile.PL000644 €^—³€)—Ue00000001121 13043661104 021371 0ustar00rgarciaCORPAD\Domain Users000000 000000 use ExtUtils::MakeMaker; use 5.008; WriteMakefile( AUTHOR => 'Rafael Garcia-Suarez ', NAME => "Sub::Current", ABSTRACT => "Get the current subroutine", VERSION_FROM => "lib/Sub/Current.pm", LICENSE => 'perl', META_MERGE => { 'meta-spec' => { version => 2 }, resources => { repository => { type => 'git', url => 'https://github.com/rgs/p5-Sub-Current.git', web => 'https://github.com/rgs/p5-Sub-Current', }, }, }, ); Sub-Current-0.03/PaxHeader/MANIFEST000644 777777 777777 00000000261 13043661717 022000 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 38 LIBARCHIVE.creationtime=1183550070 23 SCHILY.dev=16777220 23 SCHILY.ino=75817062 18 SCHILY.nlink=1 Sub-Current-0.03/MANIFEST000644 €^—³€)—Ue00000000416 13043661717 020570 0ustar00rgarciaCORPAD\Domain Users000000 000000 Changes Current.xs lib/Sub/Current.pm Makefile.PL MANIFEST META.yml t/01basic.t t/02specialblocks.t t/03autoload.t t/04maincv.t t/05proto.t t/06eval.t t/07recurse.t t/08anon.t t/50pod.t META.json Module JSON meta-data (added by MakeMaker) Sub-Current-0.03/PaxHeader/META.json000644 777777 777777 00000000213 13043661717 022265 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 23 SCHILY.dev=16777220 23 SCHILY.ino=75817077 18 SCHILY.nlink=1 Sub-Current-0.03/META.json000644 €^—³€)—Ue00000001364 13043661717 021063 0ustar00rgarciaCORPAD\Domain Users000000 000000 { "abstract" : "Get the current subroutine", "author" : [ "Rafael Garcia-Suarez " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.140640", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Sub-Current", "no_index" : { "directory" : [ "t", "inc" ] }, "release_status" : "stable", "resources" : { "repository" : { "type" : "git", "url" : "https://github.com/rgs/p5-Sub-Current.git", "web" : "https://github.com/rgs/p5-Sub-Current" } }, "version" : "0.03" } Sub-Current-0.03/PaxHeader/META.yml000644 777777 777777 00000000213 13043661717 022115 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 23 SCHILY.dev=16777220 23 SCHILY.ino=75817076 18 SCHILY.nlink=1 Sub-Current-0.03/META.yml000644 €^—³€)—Ue00000000727 13043661717 020715 0ustar00rgarciaCORPAD\Domain Users000000 000000 --- abstract: 'Get the current subroutine' author: - 'Rafael Garcia-Suarez ' build_requires: {} dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.140640' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Sub-Current no_index: directory: - t - inc resources: repository: https://github.com/rgs/p5-Sub-Current.git version: '0.03' Sub-Current-0.03/PaxHeader/t000755 777777 777777 00000000214 13043661717 021036 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 23 SCHILY.dev=16777220 23 SCHILY.ino=75817058 19 SCHILY.nlink=11 Sub-Current-0.03/t/000755 €^—³€)—Ue00000000000 13043661717 017701 5ustar00rgarciaCORPAD\Domain Users000000 000000 Sub-Current-0.03/t/PaxHeader/01basic.t000644 777777 777777 00000000213 10642376420 022512 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 23 SCHILY.dev=16777220 23 SCHILY.ino=75816168 18 SCHILY.nlink=2 Sub-Current-0.03/t/01basic.t000644 €^—³€)—Ue00000000605 10642376420 021305 0ustar00rgarciaCORPAD\Domain Users000000 000000 #!perl use strict; use warnings; use Test::More tests => 5; use_ok("Sub::Current"); sub davros { ROUTINE() } is(davros(), \&davros, 'davros'); sub borusa { my $coderef = ROUTINE(); is($coderef, \&borusa, 'borusa'); } borusa(); sub romana { @_ = (ROUTINE(), \&romana, 'romana'); &is; } romana(); sub rassilon { is(ROUTINE(), \&rassilon, 'rassilon'); } rassilon(); Sub-Current-0.03/t/PaxHeader/02specialblocks.t000644 777777 777777 00000000213 10642440754 024252 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 23 SCHILY.dev=16777220 23 SCHILY.ino=75816162 18 SCHILY.nlink=2 Sub-Current-0.03/t/02specialblocks.t000644 €^—³€)—Ue00000000466 10642440754 023052 0ustar00rgarciaCORPAD\Domain Users000000 000000 #!perl use strict; use warnings; use Test::More tests => 4; use Sub::Current; BEGIN { ok( !defined ROUTINE, "Don't point to BEGIN" ); } CHECK { ok( !defined ROUTINE, "Don't point to CHECK" ); } INIT { ok( !defined ROUTINE, "Don't point to INIT" ); } END { ok( !defined ROUTINE, "Don't point to END" ); } Sub-Current-0.03/t/PaxHeader/03autoload.t000644 777777 777777 00000000213 10642441322 023235 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 23 SCHILY.dev=16777220 23 SCHILY.ino=75816164 18 SCHILY.nlink=2 Sub-Current-0.03/t/03autoload.t000644 €^—³€)—Ue00000000305 10642441322 022025 0ustar00rgarciaCORPAD\Domain Users000000 000000 #!perl use strict; use warnings; use Test::More tests => 3; use Sub::Current; sub AUTOLOAD { is(ROUTINE(), \&AUTOLOAD, "AUTOLOAD $::AUTOLOAD"); } sarah_jane(); leela(); sarah_jane(); # again Sub-Current-0.03/t/PaxHeader/04maincv.t000644 777777 777777 00000000213 10642377111 022707 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 23 SCHILY.dev=16777220 23 SCHILY.ino=75816163 18 SCHILY.nlink=2 Sub-Current-0.03/t/04maincv.t000644 €^—³€)—Ue00000000202 10642377111 021473 0ustar00rgarciaCORPAD\Domain Users000000 000000 #!perl use strict; use warnings; use Test::More tests => 1; use Sub::Current; ok( !defined ROUTINE, "Don't point to main CV" ); Sub-Current-0.03/t/PaxHeader/05proto.t000644 777777 777777 00000000213 10642441610 022572 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 23 SCHILY.dev=16777220 23 SCHILY.ino=75816167 18 SCHILY.nlink=2 Sub-Current-0.03/t/05proto.t000644 €^—³€)—Ue00000000431 10642441610 021362 0ustar00rgarciaCORPAD\Domain Users000000 000000 #!perl use strict; use warnings; use Test::More tests => 3; use Sub::Current; # prototype must be '' ok( defined prototype \&ROUTINE, 'proto defined' ); is( prototype \&ROUTINE, '', 'proto empty' ); # and this should compile sub skaro { ROUTINE } is(skaro(), \&skaro, 'skaro'); Sub-Current-0.03/t/PaxHeader/06eval.t000644 777777 777777 00000000213 10642442520 022360 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 23 SCHILY.dev=16777220 23 SCHILY.ino=75816166 18 SCHILY.nlink=2 Sub-Current-0.03/t/06eval.t000644 €^—³€)—Ue00000000532 10642442520 021152 0ustar00rgarciaCORPAD\Domain Users000000 000000 #!perl use strict; use warnings; use Test::More tests => 3; use Sub::Current; sub runcible { is(eval { ROUTINE() }, \&runcible, "runcible"); } runcible(); sub omega { # eval("") is a special block context ok(!defined eval q{ ROUTINE() }, "omega"); } omega(); sub master { is(do { ROUTINE() }, \&master, "master"); } master(); Sub-Current-0.03/t/PaxHeader/07recurse.t000644 777777 777777 00000000213 10642443072 023105 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 23 SCHILY.dev=16777220 23 SCHILY.ino=75816161 18 SCHILY.nlink=2 Sub-Current-0.03/t/07recurse.t000644 €^—³€)—Ue00000000446 10642443072 021703 0ustar00rgarciaCORPAD\Domain Users000000 000000 #!perl use strict; use warnings; use Test::More tests => 8; use Sub::Current; our $i = 0; sub recurse { if ($i++ < 4) { ok(1, "test i$i"); ROUTINE->(); } } recurse(); sub recurse2 { my $j = shift; if ($j > 0) { ok(1, "test j$j"); ROUTINE->($j - 1); } } recurse2(4); Sub-Current-0.03/t/PaxHeader/08anon.t000644 777777 777777 00000000213 10642677773 022412 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 23 SCHILY.dev=16777220 23 SCHILY.ino=75816165 18 SCHILY.nlink=2 Sub-Current-0.03/t/08anon.t000644 €^—³€)—Ue00000000271 10642677773 021204 0ustar00rgarciaCORPAD\Domain Users000000 000000 #!perl use strict; use warnings; use Test::More tests => 2; use Sub::Current; my $anon; $anon = sub { is(ROUTINE(), $anon, "anon sub"); }; $anon->(); my $copy = $anon; $copy->(); Sub-Current-0.03/t/PaxHeader/50pod.t000644 777777 777777 00000000213 10640477471 022225 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 23 SCHILY.dev=16777220 23 SCHILY.ino=75816160 18 SCHILY.nlink=2 Sub-Current-0.03/t/50pod.t000644 €^—³€)—Ue00000000243 10640477471 021016 0ustar00rgarciaCORPAD\Domain Users000000 000000 #!perl use strict; use warnings; use Test::More; eval "use Test::Pod 1.14"; plan skip_all => "Test::Pod 1.14 required for testing POD" if $@; all_pod_files_ok(); Sub-Current-0.03/lib/PaxHeader/Sub000755 777777 777777 00000000213 13043661717 022071 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 23 SCHILY.dev=16777220 23 SCHILY.ino=75817069 18 SCHILY.nlink=3 Sub-Current-0.03/lib/Sub/000755 €^—³€)—Ue00000000000 13043661717 020735 5ustar00rgarciaCORPAD\Domain Users000000 000000 Sub-Current-0.03/lib/Sub/PaxHeader/Current.pm000644 777777 777777 00000000213 13043661535 024121 xustar00rgarciaCORPAD\Domain Users000000 000000 17 gid=697783653 18 uid=1586958771 20 ctime=1485792207 20 atime=1485792207 23 SCHILY.dev=16777220 23 SCHILY.ino=75816909 18 SCHILY.nlink=2 Sub-Current-0.03/lib/Sub/Current.pm000644 €^—³€)—Ue00000002173 13043661535 022716 0ustar00rgarciaCORPAD\Domain Users000000 000000 package Sub::Current; our $VERSION = '0.03'; require XSLoader; XSLoader::load('Sub::Current', $VERSION); sub import { *{caller() . '::ROUTINE'} = *ROUTINE; } __END__ =head1 NAME Sub::Current - Get the current subroutine =head1 SYNOPSIS use Sub::Current; sub f { # ... if ($some_condition) { # let's recurse! ROUTINE->(); } # ... } =head1 DESCRIPTION Sub::Current makes available a function C, 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) C will return undef as well. B: on perl 5.16.0 and later you can use the built-in C<__SUB__> instead, enabled by the pragma C. =head1 SOURCE A repository for the sources is at L. =head1 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. =cut