I've separated subroutines into several files that I load into the main script using requireThat sounds like Perl 4-style, around 20 years behind the curve. Place your subroutines into one or more modules. Make each module testable in isolation. To put that to the proof, write some unit tests for each module. See perlmod and Test::More.
I have some global variables that I define in the main script, and that are used throughout the sub-scriptsGlobal variables are evil. Ruthlessly eliminate them. Clearly define the inputs and outputs of each of your subroutines. With that done, eliminating the nasty globals should be a doddle.
I heard, for the first time, that it's good practice to "use strict"In addition to "use strict", add "use warnings".
In reply to Re: Using variables in require file... not possible?
by eyepopslikeamosquito
in thread Using variables in require file... not possible?
by tunafish
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |