http://www.perlmonks.org?node_id=95918

sierrathedog04 was baffled recently about me saying I was going to patch Perl. Allow me to shed some light on the subject.

To patch Perl, you don't need to know very much C -- rather, you need to know a lot of perl. No, not Perl, but perl. The code for perl is written in C, and there are more macros in the code than you can imagine. I've never done any really involving work with the perl source code, but I plan to in the future.

The problem I worked on most recently was putting a warning around the use of the /o modifier with a qr// object. There were several places that needed patching: Only a little bit of actual C code was required. The rest, though, is just as important. The only reason Perl is documented as much as it is, is because real people have spent time documenting it. When Perl changes, the documentation must change. Tests must be created to ensure the change works as expected, and doesn't break other things.

As for submitting the patch, P5P (the Perl5-Porters) prefer patches in "universal diff" format (diff -u OLD NEW). After submitting my patch to perl5-porters@perl.org, feedback comes in about something that I may not have handled correctly, or suggesting a different course of action. Finally, after things work and people are happy, Jarkko, the Perl Patch Pumpking, lets me know that my patch has been "applied, thanks."

What Perl did I patch? The most recent "snapshot" of version 5.7.1, also known as "bleadperl". This is the development branch of Perl 5.6.1, indicated by the odd number. (When Perl 5.8 comes out, development will occur in 5.9.)

For more information, read the perlhack.pod documentation, found in the Perl 5.6 docs.

japhy -- Perl and Regex Hacker

Replies are listed 'Best First'.
Re: What? I patched Perl?
by mattr (Curate) on Jul 12, 2001 at 12:21 UTC
    I was wondering if a module could provide suggestions about programming style to students of Perl. For example "You also could have used hash slices!", etc.

    I was reading about B::Deparse and B::Lint. Can Lint be easily extended?

    Maybe we could run people's code through such a utility on this site :)

Re: What? I patched Perl?
by runrig (Abbot) on Jul 13, 2001 at 01:25 UTC
    As for submitting the patch, P5P (the Perl5-Porters) prefer patches in "universal diff" format (diff -u OLD NEW).

    And if you (like me) don't have the 'u' option (or diff for that matter), grab gnu diff from http://www.gnu.org/directory/diffutils.html (or elsewhere for binaries).

    Update: On Win32, at least get get UnxUtils, if not Cygwin.

Re: What? I patched Perl?
by John M. Dlugosz (Monsignor) on Jul 13, 2001 at 01:18 UTC
    The code for perl is written in C, and there are more macros in the code than you can imagine.

    I count 13,986.

    Gross.