On 3/13/22 16:12, Shawn H Corey wrote:
Each module has its own runtime. That is, a module is loaded, compiled
and run; all before the main program. In other words, when the module
returns from its `use` statement, it has already run.
AIUI that is the view from 20,000 ft.. But, there are
On 3/13/22 15:44, Diab Jerius wrote:
On Sun, Mar 13, 2022, 18:19 Shawn H Corey wrote:
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
ok 9 - foo44
1..9
# Looks like you failed 2 tests of 9.
Exporter-circular-use-20220313-185149.tar.gz
Description: application/gzip
ed subroutine ::foo called at Bar12.pm line 23.
not ok 5 - foo12
# Failed test 'foo12'
# at ./Exporter-circular-use.t line 24.
# got: 'main=7
# foo=6
# bar=5
# '
# expected: 'main=7
# foo=6
# bar=5
#foo=4
# bar=3
# foo=2
# bar=1
# '
ok 6 - foo21
ok 7 - foo22
On Sun, Mar 13, 2022 at 1:14 PM David Christensen
wrote:
module-authors:
I have been wrestling with the Exporter module and subroutine circular
dependencies between modules for a number of years. I have yet to find
On 3/13/22 14:57, Karen Etheridge wrote:
> I haven't looked at your code,
On 3/13/22 19:12, Shawn H Corey wrote:
On 2022-03-13 18:44, Diab Jerius wrote:
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
On 2022-03-13 18:44, Diab Jerius wrote:
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).
Each
On Sun, Mar 13, 2022, 18:19 Shawn H Corey 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
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
On 3/13/22 16:13, David Christensen wrote:
module-authors:
I have been wrestling with the Exporter module and subroutine circular
dependencies between modules for a number of years. I have yet to
find a satisfactory solution.
[...]
What is the "proper" way to avoid or solve the problem
I haven't looked at your code, but I assume what you're doing is exporting
a sub from each module, and something in each of those modules is calling
each of those subs in turn, using the exported symbol. This is indeed an
unresolvable circular dependency because unqualified sub names must be
xporter-circular-use-20220313-113141.tar.gz
Description: application/gzip
12 matches
Mail list logo