On Sunday, June 23, 2002, at 02:04 , 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

You just arrived at the need to understand

        peldoc h2xs

        perldoc sub
        perldoc mod
        perldoc modlib
        perldoc modinstall

since what you want to get into is "so how do I write perl modules"
so that I can just have this set of functions passed around in a
simple and standard way....

If you use the h2xs trick - then you will be able to install
it everywhere you want to be - and can then reference your
own happy functions the simple way

        use MyNameSpace::ThatModule qw/:std :freak/;

you may want to peek at:

  http://www.wetware.com/drieux/CS/Proj/PID/

where I have the typescript of how to do a simple h2xs -AX FOO::BAR
and some of the advice on that side.

Give me about an hour and the upgrade to the alternative
strategy will be up at

  http://www.wetware.com/drieux/CS/Proj/GlobalGame/

where I go into doing these things in a more OO's Manner.


ciao
drieux

---


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

Reply via email to