]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - indirect.xs
Properly handle heredocs
[perl/modules/indirect.git] / indirect.xs
index 9e8dc99bdb995fd2979471cf13dadbb945cb04ab..ee702c61c6f64f575a02970da3fafde7206039a5 100644 (file)
@@ -146,6 +146,9 @@ static SV *indirect_hint(pTHX) {
 # ifndef PL_lex_inwhat
 #  define PL_lex_inwhat PL_parser->lex_inwhat
 # endif
+# ifndef PL_multi_close
+#  define PL_multi_close PL_parser->multi_close
+# endif
 #else
 # ifndef PL_linestr
 #  define PL_linestr PL_Ilinestr
@@ -159,6 +162,9 @@ static SV *indirect_hint(pTHX) {
 # ifndef PL_lex_inwhat
 #  define PL_lex_inwhat PL_Ilex_inwhat
 # endif
+# ifndef PL_multi_close
+#  define PL_multi_close PL_Imulti_close
+# endif
 #endif
 
 /* ... Safe version of call_sv() ........................................... */
@@ -333,8 +339,11 @@ static OP *indirect_ck_const(pTHX_ OP *o) {
 
   if (SvPOK(sv) && (SvTYPE(sv) >= SVt_PV)) {
    STRLEN pos;
+   const char *bufptr;
+
+   bufptr = PL_multi_close == '<' ? PL_bufptr : PL_oldbufptr;
 
-   if (indirect_find(sv, PL_oldbufptr, &pos)) {
+   if (indirect_find(sv, bufptr, &pos)) {
     STRLEN len;
 
     /* If the constant is equal to the current package name, try to look for