... zillions of lines of subs our $foo; or use vars qw($foo); ... followed by your main logic