develooper Front page | perl.perl5.porters | Postings from October 2011

[perl #101976] [PATCH] Remove cruft from the module example

Thread Previous | Thread Next
Michael G Schwern
October 23, 2011 01:39
[perl #101976] [PATCH] Remove cruft from the module example
Message ID:
# New Ticket Created by  Michael G Schwern 
# Please include the string:  [perl #101976]
# in the subject line of all future correspondence about this issue. 
# <URL: >

I noticed that the module example in perlmod is a bit long, crufty and out of
date.  I wouldn't teach someone to write a module like that.  It hasn't been
seriously touched in about 10 years.  This patch fixes up the most glaring
problems while retaining its utility as a teaching boilerplate.

* require Exporter instead of use with no import
* Declare and initialize variables together.
* Eliminate archaic RCS/CVS versioning clutter.
* Explain what @ISA does.
* Remove archaic (and slower) &func syntax from exporting
* Remove %EXPORT_TAGS.  It's not explained and rarely used.
* Remove redundant @EXPORT_OK
* Use cleaner $priv_func->() syntax rather than &$priv_func.
* Eliminate prototypes, they're clutter, rarely used and dangerous.

125. Two drink limit does not mean two kinds of drinks.
    -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About