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

Re: Exporter and subroutine circular dependencies between modules

Thread Previous | Thread Next
From:
Shawn H Corey
Date:
March 13, 2022 22:19
Subject:
Re: Exporter and subroutine circular dependencies between modules
Message ID:
8e3ac525-d759-365c-8e26-3f395a784308@gmail.com
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`.

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