in reply to Re: subroutine xyz redefined at ...
in thread subroutine xyz redefined at ...

So when B.pm loads A.pm, it overwrites everything that A.pm already put in the symbol table, and you get your error. Given that you can isolate code that uses A.pm explicitly from that which uses B.pm and success loading B.pm implies A.pm will load successfully, I think the simplest answer is to isolate the blocks of code from each other. For example:

{ use B ; # do stuff which only requires B } { use A; # do stuff which only requires A }

Replies are listed 'Best First'.
Re^3: subroutine xyz redefined at ...
by jeanluca (Deacon) on Aug 25, 2009 at 09:50 UTC
    testing your solution gives me the exact same warning!

    UPDATE: Also, the use statements are executed when the program starts, so the blocks around it do not influence which module is used. Depending on which is processed last, is used!
      Sorry, I assumed by controlling packages your issue would be resolved. After a little testing with some dummy modules (you have yet to specify which modules you are using), I've verified you can suppress the warning assuming it is resulting from uncontrolled exports from the modules. Since A.pm is exporting twice, you can prevent it from exporting any subroutines when you use it explicitly by modding your use statement to:

      use A qw();

      yielding a final code

      use A qw(); use B ; #.... do something