sharing perl code between directories

A

adam.at.prisma

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
 
T

Tad J McClellan

adam.at.prisma said:
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?
 
R

Ron Bergin

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
 
T

Tim Greer

adam.at.prisma said:
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.
 
A

adam.at.prisma

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top