in reply to Global vars?
To begin with, accessing global variables from a subroutine is poor programming practice.
If you have a large number of separate variables, I bet some of them belong together, just like the left and right headlights and left and right windshield wipers and the four tires on my car belong together. You could combine these into a more complex data structure, a car, and then pass only one variable, instead of eight.
Instead of passing the variable, and having the data copied inside the routine, and then copied again on the return from the routine, pass a referencece to the variable, so that no copying is done at all.
if you've now grouped variables and routines into various categories, say those dealing with your car, those dealing with your kitchen, those dealing with your printer, aggregate the data and routines into objects. While it may seem excessive for a small project, the objects will probably be small and simple, and hopefully you can re-use them in other projects. Type perldoc perlboot ( then perldoc perltoot1, and next perldoc perltoot2 ) to learn about objects, and then buy Randall Schwatrz's Learning Perl Objects, References & Modules to perfect your understanding.
--
TTTATCGGTCGTTATATAGATGTTTGCA
|
|---|