Re: Exporter and subroutine circular dependencies between modules

[email protected] (Shawn H Corey) Sun, 13 Mar 2022 18:18:48 -0400
Newsgroups perl.module-authors
Message-ID <[email protected]>
--------------ATGPL8lO38dE0cA7jyB005dZ
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

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`.

--------------ATGPL8lO38dE0cA7jyB005dZ
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">On 2022-03-13 18:08, Diab Jerius via
      module-authors wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:[email protected]">
      <blockquote>
        <p>require Exporter;<br>
          our @ISA    = qw( Exporter );<br>
          our @EXPORT    = qw( foo )</p>
      </blockquote>
    </blockquote>
    <p>I prefer this way:</p>
    <p><font face="monospace"># --------------------------------------<br>
        # Exports<br>
        use  Exporter      qw( import );<br>
        our @EXPORT      = qw( foo );<br>
        our @EXPORT_OK   = qw( );<br>
        our %EXPORT_TAGS = (<br>
            all  =&gt; [ @EXPORT, @EXPORT_OK ],<br>
        );</font><br>
      <br>
      This automatically creates a tag for `:all`.<br>
    </p>
  </body>
</html>

--------------ATGPL8lO38dE0cA7jyB005dZ--