Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

What? I patched Perl?

by japhy (Canon)
on Jul 12, 2001 at 08:05 UTC ( #95918=perlmeditation: print w/ replies, xml ) Need Help??

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:
  • toke.c - adding code to alert "Useless use of /o modifier" in the S_scan_pat() function
  • pod/perldiag.pod - adding extended information about the warning (raised when use warnings 'syntax' is active
  • pod/perlop.pod - adding information about the uselessness of qr//o
  • t/warn/toke - adding tests to make sure the warning is raised
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

Comment on What? I patched Perl?
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 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.

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://95918]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (11)
As of 2014-09-03 08:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (35 votes), past polls