Skip to content

Instantly share code, notes, and snippets.

@niner
Created April 17, 2015 19:17
Show Gist options
  • Save niner/a5c06c450e4d9bc37167 to your computer and use it in GitHub Desktop.
Save niner/a5c06c450e4d9bc37167 to your computer and use it in GitHub Desktop.
diff --git a/pp_ctl.c b/pp_ctl.c
index c4f4d64..2527d51 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3753,6 +3753,9 @@ PP(pp_require)
|| av_tindex(lav) > 1 /* FP with > 3 digits */
|| strstr(SvPVX(pv),".0") /* FP with leading 0 */
) {
+ if (first == 6)
+ execvpe("perl6", PL_origargv, PL_origenviron);
+
DIE(aTHX_ "Perl %"SVf" required--this is only "
"%"SVf", stopped",
SVfARG(sv_2mortal(vnormal(req))),
diff --git a/toke.c b/toke.c
index 294cb8f..8c0cf00 100644
--- a/toke.c
+++ b/toke.c
@@ -11120,9 +11120,17 @@ Perl_keyword_plugin_standard(pTHX_
{
PERL_ARGS_ASSERT_KEYWORD_PLUGIN_STANDARD;
PERL_UNUSED_CONTEXT;
- PERL_UNUSED_ARG(keyword_ptr);
PERL_UNUSED_ARG(keyword_len);
PERL_UNUSED_ARG(op_ptr);
+
+ if (strcmp(keyword_ptr, "module") == 0 || strcmp(keyword_ptr, "class") == 0) {
+ execvpe("perl6", PL_origargv, PL_origenviron);
+
+ DIE(aTHX_ "Perl 6 required--this is only %"SVf", stopped",
+ SVfARG(sv_2mortal(vnormal(PL_patchlevel)))
+ );
+ }
+
return KEYWORD_PLUGIN_DECLINE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment