Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > sharing perl code between directories

Reply
Thread Tools

sharing perl code between directories

 
 
adam.at.prisma
Guest
Posts: n/a
 
      10-31-2008
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
 
Reply With Quote
 
 
 
 
Tad J McClellan
Guest
Posts: n/a
 
      10-31-2008
adam.at.prisma <(E-Mail Removed)> 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/"
 
Reply With Quote
 
 
 
 
Ron Bergin
Guest
Posts: n/a
 
      10-31-2008
On Oct 31, 1:15*am, "adam.at.prisma" <(E-Mail Removed)> 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
 
Reply With Quote
 
Tim Greer
Guest
Posts: n/a
 
      10-31-2008
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!
 
Reply With Quote
 
adam.at.prisma
Guest
Posts: n/a
 
      11-17-2008
On Oct 31, 9:15*am, "adam.at.prisma" <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
virtual directories/physical directories in IIS Paul F ASP .Net 4 06-25-2008 04:04 PM
Difference between bin and obj directories and difference between project references and dll references jakk ASP .Net 4 03-22-2005 09:23 PM
Multiple bin-directories with virtual directories? =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?= ASP .Net 0 11-09-2004 05:49 PM
How to map Project directories to Production sub-directories Joel Finkel ASP .Net 0 09-12-2003 06:47 PM
Using virtual directories for common directories (scripts, images, styles, etc.) Jeffry van de Vuurst ASP .Net 2 07-30-2003 07:00 PM



Advertisments