Skip to content

Instantly share code, notes, and snippets.

@exodist
Created June 24, 2020 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save exodist/e7f7bcce3d015a371433155d6bb6d481 to your computer and use it in GitHub Desktop.
Save exodist/e7f7bcce3d015a371433155d6bb6d481 to your computer and use it in GitHub Desktop.
Perl_ppaddr_t orig_subhandler;
static OP* my_subhandler(pTHX) {
OP* out = orig_subhandler(aTHX);
char *file = CopFILE(cCOPx(out));
printf("xxx %s\n", file);
return out;
}
[...]
BOOT:
{
MY_CXT_INIT;
orig_subhandler = PL_ppaddr[OP_ENTERSUB];
PL_ppaddr[OP_ENTERSUB] = my_subhandler;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment