Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: use directives

by Herkum (Parson)
on Aug 04, 2009 at 20:46 UTC ( [id://785894]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://785894]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-20 04:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found