in reply to Do file.pl (replacing subs?)
If you do decide to use a multi-file approach, I strongly recommend using "require" instead of "do" (for reasons already listed in this thread), and making the individual files separate packages with subs and nothing in their main:: space. This is a much cleaner way to do it, and avoids many problems with scoping and potential conflicts. Otherwise you'll have to keep track of which subs you have in each file and make sure you don't accidentally name two of the same, and ditto for global variables.
|
|---|