Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best way to organize a project ?

Status
Not open for further replies.

user2base

Technical User
Oct 16, 2002
29
0
0
GB
I am writing a project involving 10 to 20 perl scripts calling subroutines that I have organised in modules (.pm files). I have also one .pm file that contains all my global variables. I am not using packages because I don't feel the need for different namespaces here.

Is it the best and more efficient way to do this ?
Especially because each .pl script will start with several "USE Module" statement and the Module.pm file themselves could contain references to others modules.

for instance if a.pl contains "USE module1;" and "USE module2;" and module1.pm contains "USE module2;" will a.pl try to compule module2 twice leading bad performances ?

What is the best way to define global variables without using packages ??

Thx.
U.

 
You needn't worry about using packages to split things up, packages are easy enough for even me to use.

There's an example of how to have global constants in this thread here thread219-418938 and this method will work for variables as well.

Try and avoid that kind of circular "use" statement, it gets confusing.

Don't fight the packages thing, it's a useful tool/technique and is part of the basis for the Object Oriented stuff you'll want later on. Mike

"Experience is the comb that Nature gives us, after we are bald."

Is that a haiku?
I never could get the hang
of writing those things.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top