| 1 | package Seis::Sub; | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | use utf8; | ||
| 5 | use 5.010_001; | ||
| 6 | |||
| 7 | package # Hide from PAUSE | ||
| 8 | Sub; | ||
| 9 | |||
| 10 | use B; | ||
| 11 | |||
| 12 | sub _new { | ||
| 13 | my ($class, $code) = @_; | ||
| 14 | bless {code => $code}, $class; | ||
| 15 | } | ||
| 16 | |||
| 17 | sub name { | ||
| 18 | my $self = shift; | ||
| 19 | my $coderef = $self->{code}; | ||
| 20 | my $b = B::svref_2object($coderef); | ||
| 21 | my $cvflags = $b->CvFLAGS; | ||
| 22 | '&'.join('::', $b->GV->STASH->NAME, $b->GV->NAME); | ||
| 23 | } | ||
| 24 | |||
| 25 | sub nextwith { | ||
| 26 | my $code = shift; | ||
| 27 | goto $code; | ||
| 28 | } | ||
| 29 | |||
| 30 | 1; | ||
| 31 | __END__ |