Cari di Perl 
    Perl User Manual
Daftar Isi
(Sebelumnya) Perl's IO abstraction int ...Walk through the creation of a ... (Berikutnya)
Internals and C language interface

How to hack on Perl

Daftar Isi

NAME

perlhack - How to hack on Perl

DESCRIPTION

This document explains how Perl development works. It includes detailsabout the Perl 5 Porters email list, the Perl repository, the Perlbugbug tracker, patch guidelines, and commentary on Perl developmentphilosophy.

SUPER QUICK PATCH GUIDE

If you just want to submit a single small patch like a pod fix, a testfor a bug, comment fixes, etc., it's easy! Here's how:

  • Check out the source repository

    The perl source is in a git repository. You can clone the repositorywith the following command:

    1. % git clone git://perl5.git.perl.org/perl.git perl
  • Make your change

    Hack, hack, hack.

  • Test your change

    You can run all the tests with the following commands:

    1. % ./Configure -des -Dusedevel
    2. % make test

    Keep hacking until the tests pass.

  • Commit your change

    Committing your work will save the change on your local system:

    1. % git commit -a -m 'Commit message goes here'

    Make sure the commit message describes your change in a singlesentence. For example, "Fixed spelling errors in perlhack.pod".

  • Send your change to perlbug

    The next step is to submit your patch to the Perl core ticket systemvia email.

    Assuming your patch consists of a single git commit, the followingwrites the file as a MIME attachment, and sends it with a meaningfulsubject:

    1. % git format-patch -1 --attach
    2. % perlbug -s "[PATCH] $(git log -1 --oneline HEAD)" -f 0001-*.patch

    The perlbug program will ask you a few questions about your emailaddress and the patch you're submitting. Once you've answered them itwill submit your patch via email.

  • Thank you

    The porters appreciate the time you spent helping to make Perl better.Thank you!

BUG REPORTING

If you want to report a bug in Perl, you must use the perlbugcommand line tool. This tool will ensure that your bug report includesall the relevant system and configuration information.

To browse existing Perl bugs and patches, you can use the web interfaceat http://rt.perl.org/.

Please check the archive of the perl5-porters list (see below) and/orthe bug tracking system before submitting a bug report. Often, you'llfind that the bug has been reported already.

You can log in to the bug tracking system and comment on existing bugreports. If you have additional information regarding an existing bug,please add it. This will help the porters fix the bug.

PERL 5 PORTERS

The perl5-porters (p5p) mailing list is where the Perl standarddistribution is maintained and developed. The people who maintain Perlare also referred to as the "Perl 5 Porters", "p5p" or just the"porters".

A searchable archive of the list is available athttp://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/. There isalso another archive athttp://archive.develooper.com/[email protected]/.

perl-changes mailing list

The perl5-changes mailing list receives a copy of each patch that getssubmitted to the maintenance and development branches of the perlrepository. See http://lists.perl.org/list/perl5-changes.html forsubscription and archive information.

#p5p on IRC

Many porters are also active on the irc://irc.perl.org/#p5p channel.Feel free to join the channel and ask questions about hacking on thePerl core.

GETTING THE PERL SOURCE

All of Perl's source code is kept centrally in a Git repository atperl5.git.perl.org. The repository contains many Perl revisions fromPerl 1 onwards and all the revisions from Perforce, the previousversion control system.

For much more detail on using git with the Perl repository, please seeperlgit.

Read access via Git

You will need a copy of Git for your computer. You can fetch a copy ofthe repository using the git protocol:

  1. % git clone git://perl5.git.perl.org/perl.git perl

This clones the repository and makes a local copy in the perldirectory.

If you cannot use the git protocol for firewall reasons, you can alsoclone via http, though this is much slower:

  1. % git clone http://perl5.git.perl.org/perl.git perl

Read access via the web

You may access the repository over the web. This allows you to browsethe tree, see recent commits, subscribe to RSS feeds for the changes,search for particular commits and more. You may access it athttp://perl5.git.perl.org/perl.git. A mirror of the repository isfound at http://github.com/mirrors/perl.

Read access via rsync

You can also choose to use rsync to get a copy of the current sourcetree for the bleadperl branch and all maintenance branches:

  1. % rsync -avz rsync://perl5.git.perl.org/perl-current .
  2. % rsync -avz rsync://perl5.git.perl.org/perl-5.12.x .
  3. % rsync -avz rsync://perl5.git.perl.org/perl-5.10.x .
  4. % rsync -avz rsync://perl5.git.perl.org/perl-5.8.x .
  5. % rsync -avz rsync://perl5.git.perl.org/perl-5.6.x .
  6. % rsync -avz rsync://perl5.git.perl.org/perl-5.005xx .

(Add the --delete option to remove leftover files.)

To get a full list of the available sync points:

  1. % rsync perl5.git.perl.org::

Write access via git

If you have a commit bit, please see perlgit for more details onusing git.

PATCHING PERL

If you're planning to do more extensive work than a single small fix,we encourage you to read the documentation below. This will help youfocus your work and make your patches easier to incorporate into thePerl source.

Submitting patches

If you have a small patch to submit, please submit it via perlbug. Youcan also send email directly to [email protected]. Please note thatmessages sent to perlbug may be held in a moderation queue, so youwon't receive a response immediately.

You'll know your submission has been processed when you receive anemail from our ticket tracking system. This email will give you aticket number. Once your patch has made it to the ticket trackingsystem, it will also be sent to the [email protected] list.

Patches are reviewed and discussed on the p5p list. Simple,uncontroversial patches will usually be applied without any discussion.When the patch is applied, the ticket will be updated and you willreceive email. In addition, an email will be sent to the p5p list.

In other cases, the patch will need more work or discussion. That willhappen on the p5p list.

You are encouraged to participate in the discussion and advocate foryour patch. Sometimes your patch may get lost in the shuffle. It'sappropriate to send a reminder email to p5p if no action has been takenin a month. Please remember that the Perl 5 developers are allvolunteers, and be polite.

Changes are always applied directly to the main development branch,called "blead". Some patches may be backported to a maintenance branch.If you think your patch is appropriate for the maintenance branch,please explain why when you submit it.

Getting your patch accepted

If you are submitting a code patch there are several things that youcan do to help the Perl 5 Porters accept your patch.

Patch style

If you used git to check out the Perl source, then using gitformat-patch will produce a patch in a style suitable for Perl. Theformat-patch command produces one patch file for each commit youmade. If you prefer to send a single patch for all commits, you can usegit diff.

  1. % git checkout blead
  2. % git pull
  3. % git diff blead my-branch-name

This produces a patch based on the difference between blead and yourcurrent branch. It's important to make sure that blead is up to datebefore producing the diff, that's why we call git pull first.

We strongly recommend that you use git if possible. It will make yourlife easier, and ours as well.

However, if you're not using git, you can still produce a suitablepatch. You'll need a pristine copy of the Perl source to diff against.The porters prefer unified diffs. Using GNU diff, you can produce adiff like this:

  1. % diff -Npurd perl.pristine perl.mine

Make sure that you make realclean in your copy of Perl to remove anybuild artifacts, or you may get a confusing result.

Commit message

As you craft each patch you intend to submit to the Perl core, it'simportant to write a good commit message. This is especially importantif your submission will consist of a series of commits.

The first line of the commit message should be a short descriptionwithout a period. It should be no longer than the subject line of anemail, 50 characters being a good rule of thumb.

A lot of Git tools (Gitweb, GitHub, git log --pretty=oneline, ...) willonly display the first line (cut off at 50 characters) when presentingcommit summaries.

The commit message should include a description of the problem that thepatch corrects or new functionality that the patch adds.

As a general rule of thumb, your commit message should help aprogrammer who knows the Perl core quickly understand what you weretrying to do, how you were trying to do it, and why the change mattersto Perl.

  • Why

    Your commit message should describe why the change you are making isimportant. When someone looks at your change in six months or sixyears, your intent should be clear.

    If you're deprecating a feature with the intent of later simplifyinganother bit of code, say so. If you're fixing a performance problem oradding a new feature to support some other bit of the core, mentionthat.

  • What

    Your commit message should describe what part of the Perl core you'rechanging and what you expect your patch to do.

  • How

    While it's not necessary for documentation changes, new tests ortrivial patches, it's often worth explaining how your change works.Even if it's clear to you today, it may not be clear to a porter nextmonth or next year.

A commit message isn't intended to take the place of comments in yourcode. Commit messages should describe the change you made, while codecomments should describe the current state of the code.

If you've just implemented a new feature, complete with doc, tests andwell-commented code, a brief commit message will often suffice. If,however, you've just changed a single character deep in the parser orlexer, you might need to write a small novel to ensure that futurereaders understand what you did and why you did it.

Comments, Comments, Comments

Be sure to adequately comment your code. While commenting every line isunnecessary, anything that takes advantage of side effects ofoperators, that creates changes that will be felt outside of thefunction being patched, or that others may find confusing should bedocumented. If you are going to err, it is better to err on the side ofadding too many comments than too few.

The best comments explain why the code does what it does, not whatit does.

Style

In general, please follow the particular style of the code you arepatching.

In particular, follow these general guidelines for patching Perlsources:

  • 8-wide tabs (no exceptions!)

  • 4-wide indents for code, 2-wide indents for nested CPP #defines

  • Try hard not to exceed 79-columns

  • ANSI C prototypes

  • Uncuddled elses and "K&R" style for indenting control constructs

  • No C++ style (//) comments

  • Mark places that need to be revisited with XXX (and revisit often!)

  • Opening brace lines up with "if" when conditional spans multiple lines;should be at end-of-line otherwise

  • In function definitions, name starts in column 0 (return value is onprevious line)

  • Single space after keywords that are followed by parens, no spacebetween function name and following paren

  • Avoid assignments in conditionals, but if they're unavoidable, useextra paren, e.g. "if (a && (b = c)) ..."

  • "return foo;" rather than "return(foo);"

  • "if (!foo) ..." rather than "if (foo == FALSE) ..." etc.

Test suite

If your patch changes code (rather than just changing documentation),you should also include one or more test cases which illustrate the bugyou're fixing or validate the new functionality you're adding. Ingeneral, you should update an existing test file rather than create anew one.

Your test suite additions should generally follow these guidelines(courtesy of Gurusamy Sarathy <[email protected]>):

  • Know what you're testing. Read the docs, and the source.

  • Tend to fail, not succeed.

  • Interpret results strictly.

  • Use unrelated features (this will flush out bizarre interactions).

  • Use non-standard idioms (otherwise you are not testing TIMTOWTDI).

  • Avoid using hardcoded test numbers whenever possible (the EXPECTED/GOTfound in t/op/tie.t is much more maintainable, and gives better failurereports).

  • Give meaningful error messages when a test fails.

  • Avoid using qx// and system() unless you are testing for them. If youdo use them, make sure that you cover _all_ perl platforms.

  • Unlink any temporary files you create.

  • Promote unforeseen warnings to errors with $SIG{__WARN__}.

  • Be sure to use the libraries and modules shipped with the version beingtested, not those that were already installed.

  • Add comments to the code explaining what you are testing for.

  • Make updating the '1..42' string unnecessary. Or make sure that youupdate it.

  • Test _all_ behaviors of a given operator, library, or function.

    Test all optional arguments.

    Test return values in various contexts (boolean, scalar, list, lvalue).

    Use both global and lexical variables.

    Don't forget the exceptional, pathological cases.

Patching a core module

This works just like patching anything else, with one extraconsideration.

Modules in the cpan/ directory of the source tree are maintainedoutside of the Perl core. When the author updates the module, theupdates are simply copied into the core. See that module'sdocumentation or its listing on http://search.cpan.org/ for moreinformation on reporting bugs and submitting patches.

In most cases, patches to modules in cpan/ should be sent upstreamand should not be applied to the Perl core individually. If a patch toa file in cpan/ absolutely cannot wait for the fix to be madeupstream, released to CPAN and copied to blead, you must add (orupdate) a CUSTOMIZED entry in the "Porting/Maintainers.pl" fileto flag that a local modification has been made. See"Porting/Maintainers.pl" for more details.

In contrast, modules in the dist/ directory are maintained in thecore.

Updating perldelta

For changes significant enough to warrant a pod/perldelta.pod entry,the porters will greatly appreciate it if you submit a delta entryalong with your actual change. Significant changes include, but are notlimited to:

  • Adding, deprecating, or removing core features

  • Adding, deprecating, removing, or upgrading core or dual-life modules

  • Adding new core tests

  • Fixing security issues and user-visible bugs in the core

  • Changes that might break existing code, either on the perl or C level

  • Significant performance improvements

  • Adding, removing, or significantly changing documentation in thepod/ directory

  • Important platform-specific changes

Please make sure you add the perldelta entry to the right sectionwithin pod/perldelta.pod. More information on how to write goodperldelta entries is available in the Style section ofPorting/how_to_write_a_perldelta.pod.

What makes for a good patch?

New features and extensions to the language can be contentious. Thereis no specific set of criteria which determine what features get added,but here are some questions to consider when developing a patch:

Does the concept match the general goals of Perl?

Our goals include, but are not limited to:

1.

Keep it fast, simple, and useful.

2.

Keep features/concepts as orthogonal as possible.

3.

No arbitrary limits (platforms, data sizes, cultures).

4.

Keep it open and exciting to use/patch/advocate Perl everywhere.

5.

Either assimilate new technologies, or build bridges to them.

Where is the implementation?

All the talk in the world is useless without an implementation. Inalmost every case, the person or people who argue for a new featurewill be expected to be the ones who implement it. Porters capable ofcoding new features have their own agendas, and are not available toimplement your (possibly good) idea.

Backwards compatibility

It's a cardinal sin to break existing Perl programs. New warnings canbe contentious--some say that a program that emits warnings is notbroken, while others say it is. Adding keywords has the potential tobreak programs, changing the meaning of existing token sequences orfunctions might break programs.

The Perl 5 core includes mechanisms to help porters make backwardsincompatible changes more compatible such as the feature anddeprecate modules. Please use them when appropriate.

Could it be a module instead?

Perl 5 has extension mechanisms, modules and XS, specifically to avoidthe need to keep changing the Perl interpreter. You can write modulesthat export functions, you can give those functions prototypes so theycan be called like built-in functions, you can even write XS code tomess with the runtime data structures of the Perl interpreter if youwant to implement really complicated things.

Whenever possible, new features should be prototyped in a CPAN modulebefore they will be considered for the core.

Is the feature generic enough?

Is this something that only the submitter wants added to the language,or is it broadly useful? Sometimes, instead of adding a feature with atight focus, the porters might decide to wait until someone implementsthe more generalized feature.

Does it potentially introduce new bugs?

Radical rewrites of large chunks of the Perl interpreter have thepotential to introduce new bugs.

How big is it?

The smaller and more localized the change, the better. Similarly, aseries of small patches is greatly preferred over a single large patch.

Does it preclude other desirable features?

A patch is likely to be rejected if it closes off future avenues ofdevelopment. For instance, a patch that placed a true and finalinterpretation on prototypes is likely to be rejected because there arestill options for the future of prototypes that haven't been addressed.

Is the implementation robust?

Good patches (tight code, complete, correct) stand more chance of goingin. Sloppy or incorrect patches might be placed on the back burneruntil the pumpking has time to fix, or might be discarded altogetherwithout further notice.

Is the implementation generic enough to be portable?

The worst patches make use of system-specific features. It's highlyunlikely that non-portable additions to the Perl language will beaccepted.

Is the implementation tested?

Patches which change behaviour (fixing bugs or introducing newfeatures) must include regression tests to verify that everything worksas expected.

Without tests provided by the original author, how can anyone elsechanging perl in the future be sure that they haven't unwittinglybroken the behaviour the patch implements? And without tests, how canthe patch's author be confident that his/her hard work put into thepatch won't be accidentally thrown away by someone in the future?

Is there enough documentation?

Patches without documentation are probably ill-thought out orincomplete. No features can be added or changed without documentation,so submitting a patch for the appropriate pod docs as well as thesource code is important.

Is there another way to do it?

Larry said "Although the Perl Slogan is There's More Than One Way toDo It, I hesitate to make 10 ways to do something". This is a trickyheuristic to navigate, though--one man's essential addition is anotherman's pointless cruft.

Does it create too much work?

Work for the pumpking, work for Perl programmers, work for moduleauthors, ... Perl is supposed to be easy.

Patches speak louder than words

Working code is always preferred to pie-in-the-sky ideas. A patch toadd a feature stands a much higher chance of making it to the languagethan does a random feature request, no matter how fervently argued therequest might be. This ties into "Will it be useful?", as the fact thatsomeone took the time to make the patch demonstrates a strong desirefor the feature.

TESTING

The core uses the same testing style as the rest of Perl, a simple"ok/not ok" run through Test::Harness, but there are a few specialconsiderations.

There are three ways to write a test in the core. Test::More,t/test.pl and ad hoc print $test ? "ok 42\n" : "not ok 42\n". Thedecision of which to use depends on what part of the test suite you'reworking on. This is a measure to prevent a high-level failure (such asConfig.pm breaking) from causing basic functionality tests to fail.

The t/test.pl library provides some of the features ofTest::More, but avoids loading most modules and uses as few corefeatures as possible.

If you write your own test, use the Test Anything Protocol.

  • t/base and t/comp

    Since we don't know if require works, or even subroutines, use ad hoctests for these two. Step carefully to avoid using the feature beingtested.

  • t/cmd, t/run, t/io and t/op

    Now that basic require() and subroutines are tested, you can use thet/test.pl library.

    You can also use certain libraries like Config conditionally, but besure to skip the test gracefully if it's not there.

  • Everything else

    Now that the core of Perl is tested, Test::More can and should beused. You can also use the full suite of core modules in the tests.

When you say "make test", Perl uses the t/TEST program to run thetest suite (except under Win32 where it uses t/harness instead). Alltests are run from the t/ directory, not the directory whichcontains the test. This causes some problems with the tests in lib/,so here's some opportunity for some patching.

You must be triply conscious of cross-platform concerns. This usuallyboils down to using File::Spec and avoiding things like fork()and system() unless absolutely necessary.

Special make test targets

There are various special make targets that can be used to test Perlslightly differently than the standard "test" target. Not all them areexpected to give a 100% success rate. Many of them have severalaliases, and many of them are not available on certain operatingsystems.

  • test_porting

    This runs some basic sanity tests on the source tree and helps catchbasic errors before you submit a patch.

  • coretest

    Run perl on all core tests (t/* and lib/[a-z]* pragma tests).

    (Not available on Win32)

  • test.deparse

    Run all the tests through B::Deparse. Not all tests will succeed.

    (Not available on Win32)

  • test.taintwarn

    Run all tests with the -t command-line switch. Not all tests areexpected to succeed (until they're specifically fixed, of course).

    (Not available on Win32)

  • minitest

    Run miniperl on t/base, t/comp, t/cmd, t/run, t/io,t/op, t/uni and t/mro tests.

  • test.valgrind check.valgrind utest.valgrind ucheck.valgrind

    (Only in Linux) Run all the tests using the memory leak + naughtymemory access tool "valgrind". The log files will be namedtestname.valgrind.

  • test.torture torturetest

    Run all the usual tests and some extra tests. As of Perl 5.8.0, theonly extra tests are Abigail's JAPHs, t/japh/abigail.t.

    You can also run the torture test with t/harness by giving-torture argument to t/harness.

  • utest ucheck test.utf8 check.utf8

    Run all the tests with -Mutf8. Not all tests will succeed.

    (Not available on Win32)

  • minitest.utf16 test.utf16

    Runs the tests with UTF-16 encoded scripts, encoded with differentversions of this encoding.

    make utest.utf16 runs the test suite with a combination of -utf8and -utf16 arguments to t/TEST.

    (Not available on Win32)

  • test_harness

    Run the test suite with the t/harness controlling program, insteadof t/TEST. t/harness is more sophisticated, and uses theTest::Harness module, thus using this test target supposes that perlmostly works. The main advantage for our purposes is that it prints adetailed summary of failed tests at the end. Also, unlike t/TEST, itdoesn't redirect stderr to stdout.

    Note that under Win32 t/harness is always used instead of t/TEST,so there is no special "test_harness" target.

    Under Win32's "test" target you may use the TEST_SWITCHES andTEST_FILES environment variables to control the behaviour oft/harness. This means you can say

    1. nmake test TEST_FILES="op/*.t"
    2. nmake test TEST_SWITCHES="-torture" TEST_FILES="op/*.t"
  • test-notty test_notty

    Sets PERL_SKIP_TTY_TEST to true before running normal test.

Parallel tests

The core distribution can now run its regression tests in parallel onUnix-like platforms. Instead of running make test, set TEST_JOBSin your environment to the number of tests to run in parallel, and runmake test_harness. On a Bourne-like shell, this can be done as

  1. TEST_JOBS=3 make test_harness # Run 3 tests in parallel

An environment variable is used, rather than parallel make itself,because TAP::Harness needs to be able to schedule individualnon-conflicting test scripts itself, and there is no standard interfaceto make utilities to interact with their job schedulers.

Note that currently some test scripts may fail when run in parallel(most notably ext/IO/t/io_dir.t). If necessary, run just the failingscripts again sequentially and see if the failures go away.

Running tests by hand

You can run part of the test suite by hand by using one of thefollowing commands from the t/ directory:

  1. ./perl -I../lib TEST list-of-.t-files

or

  1. ./perl -I../lib harness list-of-.t-files

(If you don't specify test scripts, the whole test suite will be run.)

Using t/harness for testing

If you use harness for testing, you have several command lineoptions available to you. The arguments are as follows, and are in theorder that they must appear if used together.

  1. harness -v -torture -re=pattern LIST OF FILES TO TEST
  2. harness -v -torture -re LIST OF PATTERNS TO MATCH

If LIST OF FILES TO TEST is omitted, the file list is obtained fromthe manifest. The file list may include shell wildcards which will beexpanded out.

  • -v

    Run the tests under verbose mode so you can see what tests were run,and debug output.

  • -torture

    Run the torture tests as well as the normal set.

  • -re=PATTERN

    Filter the file list so that all the test files run match PATTERN. Notethat this form is distinct from the -re LIST OF PATTERNS form belowin that it allows the file list to be provided as well.

  • -re LIST OF PATTERNS

    Filter the file list so that all the test files run match/(LIST|OF|PATTERNS)/. Note that with this form the patterns are joinedby '|' and you cannot supply a list of files, instead the test filesare obtained from the MANIFEST.

You can run an individual test by a command similar to

  1. ./perl -I../lib path/to/foo.t

except that the harnesses set up some environment variables that mayaffect the execution of the test:

  • PERL_CORE=1

    indicates that we're running this test as part of the perl core testsuite. This is useful for modules that have a dual life on CPAN.

  • PERL_DESTRUCT_LEVEL=2

    is set to 2 if it isn't set already (seePERL_DESTRUCT_LEVEL in perlhacktips).

  • PERL

    (used only by t/TEST) if set, overrides the path to the perlexecutable that should be used to run the tests (the default being./perl).

  • PERL_SKIP_TTY_TEST

    if set, tells to skip the tests that need a terminal. It's actually setautomatically by the Makefile, but can also be forced artificially byrunning 'make test_notty'.

Other environment variables that may influence tests

  • PERL_TEST_Net_Ping

    Setting this variable runs all the Net::Ping modules tests, otherwisesome tests that interact with the outside world are skipped. Seeperl58delta.

  • PERL_TEST_NOVREXX

    Setting this variable skips the vrexx.t tests for OS2::REXX.

  • PERL_TEST_NUMCONVERTS

    This sets a variable in op/numconvert.t.

See also the documentation for the Test and Test::Harness modules, formore environment variables that affect testing.

MORE READING FOR GUTS HACKERS

To hack on the Perl guts, you'll need to read the following things:

  • perlsource

    An overview of the Perl source tree. This will help you find the filesyou're looking for.

  • perlinterp

    An overview of the Perl interpreter source code and some details on howPerl does what it does.

  • perlhacktut

    This document walks through the creation of a small patch to Perl's Ccode. If you're just getting started with Perl core hacking, this willhelp you understand how it works.

  • perlhacktips

    More details on hacking the Perl core. This document focuses on lowerlevel details such as how to write tests, compilation issues,portability, debugging, etc.

    If you plan on doing serious C hacking, make sure to read this.

  • perlguts

    This is of paramount importance, since it's the documentation of whatgoes where in the Perl source. Read it over a couple of times and itmight start to make sense - don't worry if it doesn't yet, because thebest way to study it is to read it in conjunction with poking at Perlsource, and we'll do that later on.

    Gisle Aas's "illustrated perlguts", also known as illguts, has veryhelpful pictures:

    http://search.cpan.org/dist/illguts/

  • perlxstut and perlxs

    A working knowledge of XSUB programming is incredibly useful for corehacking; XSUBs use techniques drawn from the PP code, the portion ofthe guts that actually executes a Perl program. It's a lot gentler tolearn those techniques from simple examples and explanation than fromthe core itself.

  • perlapi

    The documentation for the Perl API explains what some of the internalfunctions do, as well as the many macros used in the source.

  • Porting/pumpkin.pod

    This is a collection of words of wisdom for a Perl porter; some of itis only useful to the pumpkin holder, but most of it applies to anyonewanting to go about Perl development.

  • The perl5-porters FAQ

    This should be available fromhttp://dev.perl.org/perl5/docs/p5p-faq.html . It contains hints onreading perl5-porters, information on how perl5-porters works and howPerl development in general works.

CPAN TESTERS AND PERL SMOKERS

The CPAN testers ( http://testers.cpan.org/ ) are a group of volunteerswho test CPAN modules on a variety of platforms.

Perl Smokers ( http://www.nntp.perl.org/group/perl.daily-build/ andhttp://www.nntp.perl.org/group/perl.daily-build.reports/ )automatically test Perl source releases on platforms with variousconfigurations.

Both efforts welcome volunteers. In order to get involved in smoketesting of the perl itself visithttp://search.cpan.org/dist/Test-Smoke/. In order to start smoketesting CPAN modules visithttp://search.cpan.org/dist/CPANPLUS-YACSmoke/ orhttp://search.cpan.org/dist/minismokebox/ orhttp://search.cpan.org/dist/CPAN-Reporter/.

WHAT NEXT?

If you've read all the documentation in the document and the oneslisted above, you're more than ready to hack on Perl.

Here's some more recommendations

  • Subscribe to perl5-porters, follow the patches and try and understandthem; don't be afraid to ask if there's a portion you're not clear on -who knows, you may unearth a bug in the patch...

  • Do read the README associated with your operating system, e.g.README.aix on the IBM AIX OS. Don't hesitate to supply patches to thatREADME if you find anything missing or changed over a new OS release.

  • Find an area of Perl that seems interesting to you, and see if you canwork out how it works. Scan through the source, and step over it in thedebugger. Play, poke, investigate, fiddle! You'll probably get tounderstand not just your chosen area but a much wider range ofperl's activity as well, and probably sooner than you'd think.

"The Road goes ever on and on, down from the door where it began."

If you can do these things, you've started on the long road to Perlporting. Thanks for wanting to help make Perl better - and happyhacking!

Metaphoric Quotations

If you recognized the quote about the Road above, you're in luck.

Most software projects begin each file with a literal description ofeach file's purpose. Perl instead begins each with a literary allusionto that file's purpose.

Like chapters in many books, all top-level Perl source files (alongwith a few others here and there) begin with an epigrammaticinscription that alludes, indirectly and metaphorically, to thematerial you're about to read.

Quotations are taken from writings of J.R.R. Tolkien pertaining to hisLegendarium, almost always from The Lord of the Rings. Chapters andpage numbers are given using the following editions:

  • The Hobbit, by J.R.R. Tolkien. The hardcover, 70th-anniversaryedition of 2007 was used, published in the UK by Harper CollinsPublishers and in the US by the Houghton Mifflin Company.

  • The Lord of the Rings, by J.R.R. Tolkien. The hardcover,50th-anniversary edition of 2004 was used, published in the UK byHarper Collins Publishers and in the US by the Houghton MifflinCompany.

  • The Lays of Beleriand, by J.R.R. Tolkien and published posthumouslyby his son and literary executor, C.J.R. Tolkien, being the 3rd of the12 volumes in Christopher's mammoth History of Middle Earth. Pagenumbers derive from the hardcover edition, first published in 1983 byGeorge Allen & Unwin; no page numbers changed for the special 3-volumeomnibus edition of 2002 or the various trade-paper editions, all againnow by Harper Collins or Houghton Mifflin.

Other JRRT books fair game for quotes would thus include TheAdventures of Tom Bombadil, The Silmarillion, Unfinished Tales,and The Tale of the Children of Hurin, all but the firstposthumously assembled by CJRT. But The Lord of the Rings itself isperfectly fine and probably best to quote from, provided you can find asuitable quote there.

So if you were to supply a new, complete, top-level source file to addto Perl, you should conform to this peculiar practice by yourselfselecting an appropriate quotation from Tolkien, retaining the originalspelling and punctuation and using the same format the rest of thequotes are in. Indirect and oblique is just fine; remember, it's ametaphor, so being meta is, after all, what it's for.

AUTHOR

This document was originally written by Nathan Torkington, and ismaintained by the perl5-porters mailing list.

 
Source : perldoc.perl.org - Official documentation for the Perl programming language
Site maintained by Jon Allen (JJ)     See the project page for more details
Documentation maintained by the Perl 5 Porters
(Sebelumnya) Perl's IO abstraction int ...Walk through the creation of a ... (Berikutnya)