Re: how to include a subroutine from external file?

2002-06-26 Thread drieux
On Wednesday, June 26, 2002, at 07:38 , Kipp, James wrote: so which is better? to make a lib file with functions or a modular/OOP pm file ? technically this is a false dichotomy. you can not tell if the file BAR.pm is an OO style Perl Module, or merely a Functional/Proceduralist style Perl

RE: how to include a subroutine from external file?

2002-06-26 Thread Kipp, James
so far all my libs (well there ain't much ) are all OO pm files. There is what I would call the 'dataLess' OO solution, what is known as a 'utility class' - where one has only a stack of methods that one wishes to have in a 'nameSpaceSafe' environment - so that you know that my

Re: how to include a subroutine from external file?

2002-06-24 Thread drieux
On Sunday, June 23, 2002, at 10:11 , Timothy Johnson wrote: [..] If you put the module above in a file called UC.pm in the site/lib/Tim folder, you will have a module with your reusable subroutine. The only weird part: Don't forget that the last line should be just a '1'. Just put a use

how to include a subroutine from external file?

2002-06-23 Thread Hytham Shehab
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

Re: how to include a subroutine from external file?

2002-06-23 Thread J. Lundeen
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

Re: how to include a subroutine from external file?

2002-06-23 Thread J. Lundeen
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

Re: how to include a subroutine from external file?

2002-06-23 Thread Hytham Shehab
i think that writing a module is not my answere, i think it is a huge complicated answere for a simple question. all what i want is simply put all my used subroutines in a seperate files, then call the subroutine from that file whenever i want to use the subroutine, am i clear now? no redundency

Re: how to include a subroutine from external file?

2002-06-23 Thread bob ackerman
start the file with: package utils;#or whatever name you want put your subroutines in the file: sub foo() # for instance { } end the file with: 1; # package should return true then in other files, to access: use utils; # at top of file and: foo(); # to

Re: how to include a subroutine from external file?

2002-06-23 Thread drieux
On Sunday, June 23, 2002, at 03:47 , Hytham Shehab wrote: i think that writing a module is not my answere, i think it is a huge complicated answere for a simple question. actually in the long run it will simplify the process. all what i want is simply put all my used subroutines in a

Re: how to include a subroutine from external file?

2002-06-23 Thread drieux
On Sunday, June 23, 2002, at 03:47 , Hytham Shehab wrote: [..] Hytham - as I like to warn folks, Oh sure, that's what you say today... we all start at some place... and the simple library trick is probably where we all start... Remember that you have to in essence 'fully qualify' the

RE: how to include a subroutine from external file?

2002-06-23 Thread Timothy Johnson
Subject: Re: how to include a subroutine from external file? i think that writing a module is not my answere, i think it is a huge complicated answere for a simple question. all what i want is simply put all my used subroutines in a seperate files, then call the subroutine from that file whenever i