| 1 | package UNIVERSAL::source_location_for; | ||||||||||
| 2 | 2 | ▶ | use 5.008_001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 2 | our $VERSION = '0.11'; | |||||||||
| 7 | |||||||||||
| 8 | 2 | ▶ | use B (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 2 | ▶ | use Carp qw(carp); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 0 | ▶ | sub UNIVERSAL::source_location_for { | ||||||||
|
Subroutine
source_location_for: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 12 | 0 | my($self, $method) = @_; | |||||||||
| 13 | 0 | my $entity = $self->can($method); | |||||||||
| 14 | |||||||||||
| 15 | 0 | ▶ | unless ($entity) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 0 | ▶ | carp ("Undefined subroutine " . (ref $self ? ref $self : $self) . "::" . $method); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 0 | return(); | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 0 | my $gv = B::svref_2object($entity)->GV; | |||||||||
| 21 | 0 | return($gv->FILE, $gv->LINE); | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 2 | 1; | |||||||||
| 25 | __END__ | ||||||||||