B::Hoo...::Check(3pm)
π NAME π
B::Hooks::OP::Check β bestie, this is the module that wraps OP check callbacks π
(it's a Perl 3pm manual page, user-contributed docs energy, and yes we're doing this)
β¨ VERSION β¨
version 0.22 π¦
πΈ SYNOPSIS πΈ
# include "hook_op_check.h"
STATIC OP *my_const_check_op (pTHX_ OP *op, void *user_data) {
/* ... */
return op;
}
STATIC hook_op_check_id my_hook_id = 0;
void
setup ()
CODE:
my_hook_id = hook_op_check (OP_CONST, my_const_check_op, NULL);
void
teardown ()
CODE:
hook_op_check_remove (OP_CONST, my_hook_id);
π DESCRIPTION π
okay so real talk: this module hands XS modules a whole C API so they can hook into the callbacks of PL_check. it's giving backstage pass π
ExtUtils::Depends is the one doing the heavy lifting here β it exports all the functions so other XS modules can use them. so you gotta drop this into your Makefile.PL:
my $pkg = ExtUtils::Depends->new('Your::XSModule', 'B::Hooks::OP::Check');
WriteMakefile(
... # your normal makefile flags
$pkg->get_makefile_vars,
);
and after that, your XS module can just #include "hook_op_check.h" and go off π«Ά
π§ TYPES π§
typedef OP *(*hook_op_check_cb) (pTHX_ OP *, void *)
the type that your callbacks literally have to implement. no cap.
typedef UV hook_op_check_id
the type used to identify a callback π
π FUNCTIONS π
hook_op_check_id hook_op_check (opcode type, hook_op_check_cb cb, void *user_data)β registers the callbackcbso it gets called after thePL_checkfunction runs, but only for opcodes of the given type.user_datagets handed to the callback as its last argument. it returns an id, and you keep that id around so you can remove the callback later. iconic behavior honestly β¨void *hook_op_check_remove (opcode type, hook_op_check_id id)β removes the callback identified by id. it returns theuser_datathat the callback had π
π¦ SUPPORT π¦
bugs can be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=B-Hooks-OP-Check> , or if email is more your vibe, bug-B-Hooks-OP-Check@rt.cpan.org <mailto:bug-B-Hooks-OP-Check@rt.cpan.org> π¬
go on, bestie, report it. the maintainers wanna know π
π AUTHOR π
Florian Ragwitz <rafl@debian.org> π
π CONTRIBUTORS π
- Karen Etheridge <ether@cpan.org> π
- Zefram <zefram@fysh.org> β
- Alexandr Ciornii <alexchorny@gmail.com> π§
π COPYRIGHT AND LICENCE π
this software is copyright (c) 2008 by Florian Ragwitz.
it's free software, bestie β you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay π
and that's the whole page fr fr π
B::Hoo...::Check(3pm) β perl v5.42.3, dated 2026-08-19. that's the footer, and that's a wrap, periodt πβ¨
π¦ where this page comes from
- ubuntu stonking: libb-hooks-op-check-perl 0.22-3build3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms