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

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

Thread Previous | Thread Next
From:
H.Merijn Brand
Date:
October 23, 2011 05:04
Subject:
Re: [perl #101976] [PATCH] Remove cruft from the module example
Message ID:
20111023140424.00450aed@pc09.procura.nl
On Sat, 22 Oct 2011 19:42:52 -0700, Michael G Schwern (via RT)
<perlbug-followup@perl.org> wrote:

> 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.

+1

> * Eliminate archaic RCS/CVS versioning clutter.

+1

> * Explain what @ISA does.

+1

> * Remove archaic (and slower) &func syntax from exporting

+1

> * Remove %EXPORT_TAGS.  It's not explained and rarely used.

I use them all the time in some corporate modules.

> * Remove redundant @EXPORT_OK

+1

> * Use cleaner $priv_func->() syntax rather than &$priv_func.

+1

> * Eliminate prototypes, they're clutter, rarely used and dangerous.

+1

-- 
H.Merijn Brand  http://tux.nl      Perl Monger  http://amsterdam.pm.org/
using 5.00307 through 5.14 and porting perl5.15.x on HP-UX 10.20, 11.00,
11.11, 11.23 and 11.31, OpenSuSE 10.1, 11.0 .. 11.4 and AIX 5.2 and 5.3.
http://mirrors.develooper.com/hpux/           http://www.test-smoke.org/
http://qa.perl.org      http://www.goldmark.org/jeff/stupid-disclaimers/

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