in reply to Re^2: Perl5 patches
in thread Perl5 patches

You can override CORE::GLOBAL::substr from C as well.

Approaching that issue with a separate rewrite would be the approach to take in my eyes. That way, the replacement can conveniently be tested against CPAN before the change is merged back into mainstream Perl.

Replies are listed 'Best First'.
Re^4: Perl5 patches
by BrowserUk (Patriarch) on Mar 18, 2012 at 12:13 UTC
    You can override CORE::GLOBAL::substr from C as well.

    Any pointers?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      I tried something on my own and failed. Then I remembered overload::eval, which does that, except for OP_ENTEREVAL. If you replace OP_ENTEREVAL with OP_SUBSTR, that should be all you need, save for the rewrite of substr. But then you can step-wise refine it.

        Thanks. That all looks pretty straight forward. Well, 'ceptin' these couple of lines:

        #if ((PERL_VERSION == 13) && (PERL_SUBVERSION >= 7) || (PERL_VERSION > + 13)) hook = cophh_fetch_pvn(PL_curcop->cop_hints_hash, "overload::eval" +, 14, 0, 0); #else hook = Perl_refcounted_he_fetch( aTHX_ PL_curcop->cop_hints_hash, +Nullsv, "overload::eval", 14 /* strlen */, 0, 0); #endif

        But I guess it's a case of, cargo-cult it and see how it goes :)


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        The start of some sanity?