+=head1 SYNOPSIS
+
+In your XS file :
+
+ #include "sub_op.h"
+
+ STATIC OP *scalar_util_reftype(pTHX) {
+ dSP;
+ dMARK;
+ SV *sv = POPs;
+ if (SvMAGICAL(sv))
+ mg_get(sv);
+ if (SvROK(sv))
+ PUSHs(sv_reftype(SvRV(sv), 0));
+ else
+ PUSHs(&PL_sv_undef);
+ RETURN;
+ }
+
+ MODULE = Scalar::Util::Ops PACKAGE = Scalar::Util::Ops
+
+ BOOT:
+ {
+ sub_op_config_t c;
+ c.name = "reftype";
+ c.namelen = sizeof("reftype")-1;
+ c.pp = scalar_util_reftype;
+ c.check = 0;
+ c.ud = NULL;
+ sub_op_register(aTHX_ &c);
+ }
+
+In your Perl module file :
+
+ package Scalar::Util::Ops;
+
+ use strict;
+ use warnings;
+
+ our ($VERSION, @ISA);
+
+ use Sub::Op; # Before loading our own shared library
+
+ BEGIN {
+ $VERSION = '0.01';
+ require DynaLoader;
+ push @ISA, 'DynaLoader';
+ __PACKAGE__->bootstrap($VERSION);
+ }
+
+ sub import { Sub::Op::enable(reftype => scalar caller) }
+
+ sub unimport { Sub::Op::disable(reftype => scalar caller) }
+
+ 1;
+
+In your F<Makefile.PL> :
+
+ use ExtUtils::Depends;
+
+ my $ed = ExtUtils::Depends->new('Scalar::Util::Ops' => 'Sub::Op');
+
+ WriteMakefile(
+ $ed->get_makefile_vars,
+ ...
+ );
+
+=head1 DESCRIPTION
+
+This module provides a C and Perl API for replacing subroutine calls by custom opcodes.
+This has two main advantages :
+
+=over 4
+
+=item *
+
+it gets rid of the overhead of a normal subroutine call ;
+
+=item *
+
+there's no symbol table entry defined for the subroutine.
+
+=back
+
+Subroutine calls with and without parenthesis are handled.
+Ampersand calls are B<not> replaced, and as such will still allow to call a subroutine with same name defined earlier.
+This may or may not be considered as a bug, but it gives the same semantics as Perl keywords, so I believe it's reasonable.
+
+When L<B> and L<B::Deparse> are loaded, they get automatically monkeypatched so that introspecting modules like L<B::Concise> and L<B::Deparse> still produce a valid output.
+
+=cut
+
+use Scalar::Util;
+