develooper Front page | perl.module-authors | Postings from April 2021

Re: New module: Text::Wrap::OO

Thread Previous | Thread Next
From:
Dan Book
Date:
April 6, 2021 19:21
Subject:
Re: New module: Text::Wrap::OO
Message ID:
CABMkAVUsuf8uF-PErKFT2sJOEJn+tk_GDnk+UtqvP94TbRh2MQ@mail.gmail.com
On Tue, Apr 6, 2021 at 2:19 PM Asher Gordon <AsDaGo@posteo.net> wrote:

> Hi everyone,
>
> I have just written my first Perl module (that I'm going to release). It
> is an object oriented interface to Text::Wrap. My question is, what do
> you think of the name? Is it a good name, descriptive enough? And do you
> have any other advice for releasing my first module?
>
> I don't currently have it released anywhere (I'll eventually have the
> git repository on sv.nongnu.org), and I'm not sure if an attached
> tarball would be appreciated (I can attach it if requested), but here's
> the SYNOPSIS so you can get an idea of what it does and how it works:
>
> SYNOPSIS
>    Object oriented interface
>            use Text::Wrap::OO;
>
>            my $wrapper = Text::Wrap::OO->new(init_tab => "\t");
>            $wrapper->columns(70);
>            my $wrapped = $wrapper->wrap($text);
>
>    Static method interface
>            use Text::Wrap::OO;
>
>            my $wrapped = Text::Wrap::OO->wrap(
>                {
>                    init_tab    => "\t",
>                    columns     => 70,
>                }, $text,
>            );
>
>    Exported interface
>            use Text::Wrap::OO 'wrap',
>                wrap => { columns => 70, -as => 'wrap70' };
>
>            my $wrapped = wrap {
>                init_tab        => "\t",
>                columns         => 60,
>            }, $text;
>
>            my $wrapped_70 = wrap70 {
>                huge => 'overflow',
>            }, $text;
>
> Thanks in advance,
> Asher
>
> P.S. https://pause.perl.org/pause/query?ACTION=pause_namingmodules seems
> to indicate that this is a good list for this type of question. Sorry if
> I was mistaken.
>
> --
> I have no doubt that it is a part of the destiny of the human race,
> in its gradual improvement, to leave off eating animals.
>                 -- Thoreau
>                                --------
> I prefer to send and receive mail encrypted. Please send me your
> public key, and if you do not have my public key, please let me
> know. Thanks.
>
> GPG fingerprint: 38F3 975C D173 4037 B397  8095 D4C9 C4FC 5460 8E68
>

It's a fine list for that purpose. You may also seek feedback on
https://perldoc.perl.org/perlcommunity#IRC or https://www.reddit.com/r/perl/
.

The name and design seem fine to me. Just beware providing so many options
for doing the same thing that you'll have to support them all (common
mistake of the "DWIM era" of CPAN), sometimes it is better to keep things
simple and only add alternative options once they are useful.

Also make sure you are aware that CPAN distributions must be packaged a
specific way. The first few sections of
https://metacpan.org/pod/Dist::Zilla::Starter go over this and some modern
options for authoring (you don't have to use Dist::Zilla unless it fits
your approach). http://tynovsky.github.io/cpan-tutorials/ also lays out a
quick guide to authoring with Minilla.

-Dan

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