develooper Front page | perl.perl5.porters | Postings from March 2022

Re: Pre-RFC: a `module` keyword

Thread Previous | Thread Next
Ovid via perl5-porters
March 23, 2022 09:11
Re: Pre-RFC: a `module` keyword
Message ID:
On Friday, 11 February 2022, 10:52:36 CET, Neil Bowers <> wrote:

> We think there's definitely scope for improving Perl's support for creating modules
> of function libraries, and the import mechanism.


> So in its current form, we've marked this as rejected, but we think this is an area
> that's ripe for more thought. Part of that should include a review of CPAN and the
> problems with the current options.

I've been mulling over this for some time because I wanted to have clear thoughts on it and check what's on the CPAN.

I withdraw the `:version` and `:export` parts of this, though I would love to see a lexical export solution. However, the core idea seems solid. Unfortunately, I cannot find anything on the CPAN which solidly supports what I'm looking for. Going with `library` instead of `module` as a keyword:

    library My::Library 0.01 {
        sub foo ($bar) { ... }

        library Pretty { # My::Library::Pretty
            # Public
        library Utils :private { # My::Library::Utils
            # Private to My::Library and enclosed libraries

(I get sick and tired of writing "Utils" packages to organize my code and littering the global namespace)

I could write up more (better keyword suggestions needed), but I simply can't find anything comparable on the CPAN and despite asking around, no one else has offered suggestions. Can anyone offer pointers?
IT consulting, training, specializing in Perl, databases, and agile development 

Buy my book! -

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About