sharing perl code between directories

Discussion in 'Perl Misc' started by adam.at.prisma, Oct 31, 2008.

  1. I have a directory tree in our code repository containing Perl code.
    AppOne and AppTwo both use some of the same functions and as the copy-
    paste method will get out of hand really soon, I want to create a
    "Common" directory that is visible to the other two (and likely more
    than 2 in the future).

    I've used O'Reillys excellent "Programming Perl" but I don't get how I
    make the code in the "Common" directory available to the other two?
    Btw, this is Windows and I am using "Strawberry Perl".

    +---admin
    |
    +---AppOne
    | AppOne.pl
    |
    +---AppTwo
    | AppTwoFileOne.pl
    | AppTwoFileTwo.pl
    |
    |
    \---Common
    CommonCode.pm

    BR,
    Adam
     
    adam.at.prisma, Oct 31, 2008
    #1
    1. Advertising

  2. adam.at.prisma <> wrote:
    > I have a directory tree in our code repository containing Perl code.
    > AppOne and AppTwo both use some of the same functions and as the copy-
    > paste method will get out of hand really soon, I want to create a
    > "Common" directory that is visible to the other two (and likely more
    > than 2 in the future).
    >
    > I've used O'Reillys excellent "Programming Perl" but I don't get how I
    > make the code in the "Common" directory available to the other two?



    perldoc -q module

    How do I keep my own module/library directory?


    --
    Tad McClellan
    email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
     
    Tad J McClellan, Oct 31, 2008
    #2
    1. Advertising

  3. adam.at.prisma

    Ron Bergin Guest

    On Oct 31, 1:15 am, "adam.at.prisma" <> wrote:
    > I have a directory tree in our code repository containing Perl code.
    > AppOne and AppTwo both use some of the same functions and as the copy-
    > paste method will get out of hand really soon, I want to create a
    > "Common" directory that is visible to the other two (and likely more
    > than 2 in the future).
    >
    > I've used O'Reillys excellent "Programming Perl" but I don't get how I
    > make the code in the "Common" directory available to the other two?
    > Btw, this is Windows and I am using "Strawberry Perl".
    >
    > +---admin
    > |
    > +---AppOne
    > |       AppOne.pl
    > |
    > +---AppTwo
    > |       AppTwoFileOne.pl
    > |       AppTwoFileTwo.pl
    > |
    > |
    > \---Common
    >         CommonCode.pm
    >
    > BR,
    > Adam


    perldoc -q lib
     
    Ron Bergin, Oct 31, 2008
    #3
  4. adam.at.prisma

    Tim Greer Guest

    adam.at.prisma wrote:

    > I have a directory tree in our code repository containing Perl code.
    > AppOne and AppTwo both use some of the same functions and as the copy-
    > paste method will get out of hand really soon, I want to create a
    > "Common" directory that is visible to the other two (and likely more
    > than 2 in the future).
    >
    > I've used O'Reillys excellent "Programming Perl" but I don't get how I
    > make the code in the "Common" directory available to the other two?
    > Btw, this is Windows and I am using "Strawberry Perl".
    >
    > +---admin
    > |
    > +---AppOne
    > | AppOne.pl
    > |
    > +---AppTwo
    > | AppTwoFileOne.pl
    > | AppTwoFileTwo.pl
    > |
    > |
    > \---Common
    > CommonCode.pm
    >
    > BR,
    > Adam


    So, you wan to include the module, perhaps, from the AppOne and AppTwo
    directories? Or you want to share code between the .pl files? Or? By
    the sound of it, you need to run perldoc on lib and/or module.
    --
    Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
    Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
    and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
    Industry's most experienced staff! -- Web Hosting With Muscle!
     
    Tim Greer, Oct 31, 2008
    #4
  5. On Oct 31, 9:15 am, "adam.at.prisma" <> wrote:
    > I have a directory tree in our code repository containing Perl code.
    > AppOne and AppTwo both use some of the same functions and as the copy-
    > paste method will get out of hand really soon, I want to create a
    > "Common" directory that is visible to the other two (and likely more
    > than 2 in the future).
    >
    > I've used O'Reillys excellent "Programming Perl" but I don't get how I
    > make the code in the "Common" directory available to the other two?
    > Btw, this is Windows and I am using "Strawberry Perl".
    >
    > +---admin
    > |
    > +---AppOne
    > |       AppOne.pl
    > |
    > +---AppTwo
    > |       AppTwoFileOne.pl
    > |       AppTwoFileTwo.pl
    > |
    > |
    > \---Common
    >         CommonCode.pm
    >
    > BR,
    > Adam


    Hi,

    I read through the documentation for "use lib" and that resolved the
    issue. Thanks for pointing me in the right direction folks!

    BR,
    Adam
     
    adam.at.prisma, Nov 17, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joel Finkel
    Replies:
    0
    Views:
    510
    Joel Finkel
    Sep 12, 2003
  2. Jeffry van de Vuurst
    Replies:
    2
    Views:
    552
    Jeffry van de Vuurst
    Jul 30, 2003
  3. Stu Lock
    Replies:
    1
    Views:
    632
    stefano mostarda
    Jul 7, 2004
  4. =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?=

    Multiple bin-directories with virtual directories?

    =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?=, Nov 9, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    841
    =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?=
    Nov 9, 2004
  5. jakk
    Replies:
    4
    Views:
    12,610
Loading...

Share This Page