At least the CPUs that I am familiar with, the Z80 and the x86, both had local variables in the stack, and I've used them to quite some extent in assembly language.
Personally, I believe you will be far better off by throwing your current 14-sub 3200-line script away and reimplement it as separate files. merlyn is always eager to offer code review, both public and private, and there is also the code review ladder mailing list, that also will do a Perl code review for you.
Go there, show them your code, and in the process of explaining the code to them, you will find valuable practices to keep and valuable changes to implement.
| [reply] |