| 1 |
#include "EXTERN.h" |
| 2 |
#include "perl.h" |
| 3 |
#include "XSUB.h" |
| 4 |
|
| 5 |
MODULE = Devel::Refcount PACKAGE = Devel::Refcount |
| 6 |
|
| 7 |
int |
| 8 |
refcount(ref) |
| 9 |
SV *ref |
| 10 |
|
| 11 |
CODE: |
| 12 |
if(!SvROK(ref)) { |
| 13 |
croak("ref is not a reference"); |
| 14 |
} |
| 15 |
RETVAL = SvREFCNT(SvRV(ref)); |
| 16 |
OUTPUT: |
| 17 |
RETVAL |