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:
Eric Brine
Date:
October 23, 2011 04:33
Subject:
Re: [perl #101976] [PATCH] Remove cruft from the module example
Message ID:
CALJW-qEGy4z8j7PL=orsndeN7ZLwKGXBn0iT9b16DRLqKNdocA@mail.gmail.com
On Sat, Oct 22, 2011 at 10:42 PM, Michael G Schwern <
perlbug-followup@perl.org> wrote:

> # 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
> * Explain what @ISA does.
> ...
>

Instead of changing

    use Exporter ();
    @ISA = qw(Exporter);

to

    require Exporter;
    our @ISA = qw(Exporter);

what about changing it to

    use Exporter qw( import );

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