blib/lib/UNIVERSAL/filename.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 10 | 10 | 100.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | 4 | 4 | 100.0 |
pod | n/a | ||
total | 14 | 14 | 100.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package UNIVERSAL::filename; | ||||||
2 | 2 | 2 | 764 | use strict; | |||
2 | 3 | ||||||
2 | 56 | ||||||
3 | 2 | 2 | 9 | use warnings; | |||
2 | 3 | ||||||
2 | 105 | ||||||
4 | our $VERSION = '0.03'; | ||||||
5 | |||||||
6 | BEGIN { | ||||||
7 | 2 | 2 | 1730 | require UNIVERSAL; | |||
8 | } | ||||||
9 | |||||||
10 | *UNIVERSAL::filename = sub { | ||||||
11 | 3 | 3 | 19 | my $class = shift; | |||
12 | 3 | 8 | $class =~ s{::}{/}g; | ||||
13 | 3 | 22 | $INC{$class.".pm"}; | ||||
14 | } unless defined &UNIVERSAL::filename; | ||||||
15 | |||||||
16 | 1; | ||||||
17 | __END__ |