in reply to Rewriting a large code base
At least in the beginning, this is a perfect use for Exporter. Do a find . -name RCS -prune -o -name '*.pl' -print | xargs grep GlobalVar1, then replace every instace of those with a function that does a get (or set) on the appropriate variable. One way to structure your global classes is as such:
use strict; use 5.6.0; package Global::Var_Type_1; use Exporter; our @ISA = qw(Exporter); our @EXPORT_OK = qw(get_var_1); my $var1 = 0; sub get_var_1 { return $var1; } 1;
This may sound stupid, but that means you now control every single one of these variables. And, more importantly, the biggest obstacle to getting strict turned on is removed. And, getting strict turned on is, in my opinion, the most important coding action you can do for a production system.
After that, everything everyone up above has said is perfect advice. It's all stuff I did when I was in your shoes a year ago. :)
|
|---|