my $foo; ... zillions of lines of subs ... followed by your main logic