Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: use directives

by Herkum (Parson)
on Aug 04, 2009 at 20:46 UTC ( #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/
    • /lib/
      • /lib/A/
        • /lib/A/
        • /lib/A/

    file: /myapp/ ------------------ use lib '..\lib'; use A::Common; use A::MyLib; file: /lib/ -------------------- 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 "" which is why I knew it was an issue with the using statements.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://785894]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2018-07-19 17:32 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (412 votes). Check out past polls.