blib/lib/Acme/Ref.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 9 | 16 | 56.2 |
branch | 0 | 2 | 0.0 |
condition | n/a | ||
subroutine | 3 | 4 | 75.0 |
pod | 0 | 1 | 0.0 |
total | 12 | 23 | 52.1 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Acme::Ref; | ||||||
2 | |||||||
3 | 1 | 1 | 24516 | use strict; | |||
1 | 3 | ||||||
1 | 39 | ||||||
4 | 1 | 1 | 5 | use warnings; | |||
1 | 2 | ||||||
1 | 30 | ||||||
5 | 1 | 1 | 5 | use base 'Exporter'; | |||
1 | 6 | ||||||
1 | 310 | ||||||
6 | |||||||
7 | our @EXPORT_OK = ( 'deref' ); | ||||||
8 | |||||||
9 | our $VERSION = '0.03'; | ||||||
10 | |||||||
11 | require XSLoader; | ||||||
12 | XSLoader::load('Acme::Ref', $VERSION); | ||||||
13 | |||||||
14 | sub deref { | ||||||
15 | 0 | 0 | 0 | my $str = shift; | |||
16 | 0 | 0 | unless ($str) { return } | ||||
0 | |||||||
17 | 0 | $str =~ m/^(.*)\(0x(.*)\)$/; | |||||
18 | 0 | my ($cls,$ptr) = ($1,$2); | |||||
19 | 0 | $ptr = hex($ptr); | |||||
20 | 0 | _deref($ptr); | |||||
21 | } | ||||||
22 | |||||||
23 | 1; | ||||||
24 | __END__ |