in reply to use directives

subroutine redefined errors has nothing to do with your including 'use' in your library and your script. It implies that you are you have defined a subroutine in the same namespace multiple times. For example, this code would generate that same error.

package Common; sub my_routine {}; sub my_routine {};

Without looking at your code that is as much help I can give you.

Replies are listed 'Best First'.
Re^2: use directives
by bob_dobalina (Sexton) on Aug 05, 2009 at 14:53 UTC
    thanks for all the responses. Exporter ended up having nothing to do with it, i happened to comment out a using line that got rid of my errors and thought it was Exporter related. my first post was not my real code, just trying to show the using hiearchy. Here's a better example of what I have and how I fixed it.

    Directory Structure:
    • /myapp/
      • /myapp/main.pl
    • /lib/
      • /lib/A/
        • /lib/A/Common.pm
        • /lib/A/MyLib.pm

    psuedo-code
    file: /myapp/main.pl ------------------ use lib '..\lib'; use A::Common; use A::MyLib; file: /lib/MyLib.pl -------------------- BEFORE: use lib '..\lib'; use lib '..\lib\A'; use Common; AFTER: Changing to this fixed it: use lib '..\lib'; use A::Common;

    I should note, there were no subroutines duplicated, when it was erroring it had an "subroutine duplicated" error for every subroutine and constant in "Common.pm" which is why I knew it was an issue with the using statements.