NAME

Acme::Thing - Represent anything as Perl (CPAN) module

SPECIFICATION VERSION

0.1

VERSION

This document describes version 0.1.0 of Acme::Thing (from Perl distribution Acme-Thing), released on 2023-03-19.

DESCRIPTION

Acme::Thing is a convention for representing anything as a Perl module/distribution. Custom prerequisite phase/relationship in distribution metadata can be used to relate the thing to other things. The get_thing_attrs class method can be used to rerieve attributes of the thing. The module's POD can be used to document the thing.

Naming convention

The module should be named Acme::Thing::$SUBNAMESPACE::$NAME where $SUBNAMESPACE is one or more levels of subnamespaces and $NAME is the name/title of the thing. Both $SUBNAMESPACE and $TITLE should use CamelCase notation and should be in singular noun form whenever possible. Underscore is used to separate name parts. For example, for a TV series the $NAME could be the title of the series using the IMDB convention:

Acme::Thing::TVSeries::BreakingBad_2008_2013
Acme::Thing::TvSeries::CornerGas_2004_2009

and for a book title the $NAME could be the title (without the subtitle) of the book, preferrably with the publication year. Subsequent editions of a book should be named using the nE notation. Examples:

Acme::Thing::Book::ProgrammingPerl_1991
Acme::Thing::Book::ProgrammingPerl_4E_2012

Relationship with other things

TBD.

Attributes

The module must provide a class method called get_thing_attrs (by itself or by inheritance, doesn't matter), which must return a DefHash containng attributes of the thing. The required attributes are:

  • title

    Title of the thing, in a format common for that thing.

For example, for a book title:

{
  title => "Programming Perl",
  isbn => ...,
  year => 1991,
  summary => ...,
  description => ...,
  ...
}

For a TV series:

{
  title => "Breaking Bad",
  year_first => 2008,
  year_last => 2013,
  imdb_title_id => ...,
  summary => ...,
  description => ...,
  ...
}

Why?

Now comes the harder question: why use Perl module/distribution to represent seomthing at all, other than an actual Perl module? Releasing as Perl distribution and module leverages a few things: 1) the CPAN distribution metadata (see CPAN::Meta) where a distribution can depend (relate) to other modules (other things); 2) the CPAN infrastructure where revisions of the thing can be released, distributed, tested, and installed to target systems; 3) the OO feature of the Perl language where a user can interact with a thing (e.g. download a TV series poster or trailer, etc).

Of course, none of the above suggest that a generic representation like Acme::Thing is better than a more specific one, e.g. WebService::ISBNDB for books.

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Acme-Thing.

SOURCE

Source repository is at https://github.com/perlancar/perl-Acme-Thing.

SEE ALSO

DefHash

AUTHOR

perlancar <perlancar@cpan.org>

CONTRIBUTING

To contribute, you can send patches by email/via RT, or send pull requests on GitHub.

Most of the time, you don't need to build the distribution yourself. You can simply modify the code, then test via:

% prove -l

If you want to build the distribution (e.g. to try to install it locally on your system), you can install Dist::Zilla, Dist::Zilla::PluginBundle::Author::PERLANCAR, Pod::Weaver::PluginBundle::Author::PERLANCAR, and sometimes one or two other Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond that are considered a bug and can be reported to me.

COPYRIGHT AND LICENSE

This software is copyright (c) 2023 by perlancar <perlancar@cpan.org>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Acme-Thing

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.