B::Hoo...PPAddr(3pm)

πŸ’– B::Hooks::OP::PPAddr πŸ’–

okay bestie, so this is a perl manual page (section 3pm, in case the header didn't spill the tea) and it's about hooking into opcode execution. yes, the real stuff. no cap.


✨ NAME ✨

B::Hooks::OP::PPAddr β€” hook into opcode execution πŸͺ

🌸 VERSION 🌸

version 0.06 (yes queen, it's giving stable-ish)

πŸ¦‹ SYNOPSIS πŸ¦‹

here's the vibe, copy it exactly bestie:

#include "hook_op_check.h"
#include "hook_op_ppaddr.h"

STATIC OP *
execute_entereval (pTHX_ OP *op, void *user_data) {
    ...
}

STATIC OP *
check_entereval (pTHX_ OP *op, void *user_data) {
    hook_op_ppaddr (op, execute_entereval, NULL);
}

hook_op_check (OP_ENTEREVAL, check_entereval, NULL);

that's literally it. chef's kiss πŸ’…

πŸ’œ DESCRIPTION πŸ’œ

so this module hands your XS modules a C API so they can hook into the execution of perl opcodes. main character energy for your extension module, fr fr.

ExtUtils::Depends is used to export all the functions so other XS modules can use them. drop this into your Makefile.PL:

my $pkg = ExtUtils::Depends->new('Your::XSModule', 'B::Hooks::OP::PPAddr');
WriteMakefile(
    ... # your normal makefile flags
    $pkg->get_makefile_vars,
);

and boom πŸ’₯ β€” your XS module can now #include "hook_op_ppaddr.h". slay.

πŸŽ€ TYPES πŸŽ€

OP

typedef OP *(*hook_op_ppaddr_cb_t) (pTHX_ OP *, void *user_data)

this is the type your callbacks need to implement. no exceptions bestie, it's the whole assignment. ✨

πŸ‘‘ FUNCTIONS πŸ‘‘

hook_op_ppaddr

void hook_op_ppaddr (OP *op, hook_op_ppaddr_cb_t cb, void *user_data)

this one swaps out the function that executes op and replaces it with the callback cb. and user_data? it gets passed to the callback as the last argument. just like that. 🫢

hook_op_ppaddr_around

void hook_op_ppaddr_around (OP *op, hook_op_ppaddr_cb_t before, hook_op_ppaddr_cb_t after, void *user_data)

registers the callbacks before and after so they get called before and after the execution of op. yeah, you get BOTH sides. obsessed. 😌 and yup β€” user_data gets passed to the callback as the last argument. same deal as above.

🌈 SEE ALSO 🌈

  • B::Hooks::OP::Check

πŸ“ SUPPORT πŸ“

bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=B-Hooks-OP-PPAddr> (or bug-B-Hooks-OP-PPAddr@rt.cpan.org <mailto:bug-B-Hooks-OP-PPAddr@rt.cpan.org>).

ngl if something's broken, tell the tracker, not your group chat. they actually fix things. πŸ’€

🧚 AUTHOR 🧚

Florian Ragwitz <rafl@debian.org>

⭐ CONTRIBUTORS ⭐

  • Karen Etheridge <ether@cpan.org>
  • Alexandr Ciornii <alexchorny@gmail.com>
  • Stephan Loyd <stephanloyd9@gmail.com>

This software is copyright (c) 2008 by Florian Ragwitz.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


and that's the whole page, bestie ✨ this was generated by perl v5.42.3 on 2026-08-19, and yeah the manual name got mangled to B::Hoo...PPAddr(3pm) in the footer but we all know who she is. periodt. πŸ’…πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from