If I understand what you are asking, this is how I handle it:

For each program I write I have a directory structure like this:

index.cgi
library/      -- which is a subdirectory and contains code modules that get called
by index.cgi in the "root" directory of the program.

So, within my index.cgi program, I call modules by:

do "library/nameoffile.ext";

And so long as you aren't using Strict "my" variables, the values of the variables
should get passed to the DO call and it's child calls.

As with everything Perl, there is always more than one way to handle things!    I
like this method because it helps to keep my main program "index.cgi" short and
simple.  The "meat" of the program is divided into smaller "library" calls.
Makes for easy review and modification of large programs if you need to go back to
them a year or two later!

-Jimmy James



"J. Lundeen" wrote:

> I'm not sure I understand what  you're asking. Please clarify.  -Jimmy James
>
> Hytham Shehab wrote:
>
> > hi all of you,
> >     i have a multiple perl files that use the same subroutines, the only way
> > i know to handle this - i know its not so cleaver - is to copy & paste the
> > portion of the subroutine in all perl files i want to use it, what is the
> > more clever way?
> > thx v. much
> >
> > --
> > Hytham Shehab
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to