develooper Front page | perl.module-authors | Postings from March 2022

Re: Exporter and subroutine circular dependencies between modules

Thread Previous | Thread Next
From:
Diab Jerius
Date:
March 13, 2022 22:45
Subject:
Re: Exporter and subroutine circular dependencies between modules
Message ID:
CADpyd5CGZYt=O0fNCg9xL3ph687F3BD+u7LUQztqDVNwnC61mA@mail.gmail.com
On Sun, Mar 13, 2022, 18:19 Shawn H Corey <shawnhcorey@gmail.com> wrote:

> On 2022-03-13 18:08, Diab Jerius via module-authors wrote:
>
> require Exporter;
> our @ISA    = qw( Exporter );
> our @EXPORT    = qw( foo )
>
> I prefer this way:
>
> # --------------------------------------
> # Exports
> use  Exporter      qw( import );
> our @EXPORT      = qw( foo );
> our @EXPORT_OK   = qw( );
> our %EXPORT_TAGS = (
>     all  => [ @EXPORT, @EXPORT_OK ],
> );
>
> This automatically creates a tag for `:all`.
>
I prefer yet another fashion (everything is driven by what's in
%EXPORT_TAGS), but back to the point of the OP's problem, this doesn't
initialize @EXPORT until runtime, so I think will have the same issue (I'm
away from keyboard at the moment).

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