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

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

Thread Previous | Thread Next
From:
Michael G Schwern
Date:
October 23, 2011 01:39
Subject:
[perl #101976] [PATCH] Remove cruft from the module example
Message ID:
rt-3.6.HEAD-31297-1319337771-1302.101976-75-0@perl.org
# 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: https://rt.perl.org:443/rt3/Ticket/Display.html?id=101976 >


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
           http://skippyslist.com/list/


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About