From 5f0fb29dc02d2ad322afbba1056af6a96256f907 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 21 Jul 2013 11:45:43 -0400 Subject: add a function to get the package of the currently compiling code --- Keyword.xs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Keyword.xs') diff --git a/Keyword.xs b/Keyword.xs index 91478b1..4a094e4 100644 --- a/Keyword.xs +++ b/Keyword.xs @@ -130,3 +130,10 @@ lex_read(len = 1) CODE: PL_curcop = &PL_compiling; lex_read_to(PL_parser->bufptr + len); + +SV * +compiling_package() + CODE: + RETVAL = newSVhek(HvNAME_HEK(CopSTASH(&PL_compiling))); + OUTPUT: + RETVAL -- cgit v1.2.3-54-g00ecf