I'll need to check out Safeand its family, as they may have addressed the problem.
My current thought would be to develop each function (presuming this is synonymous with a Perl subroutine in this context) initially as a stand-alone file, with use strict;and use warnings;at the top and a calling routine built in.
If it compiles without errors, there are no external references.
Then a quick process to extract only the subroutine into your main code and you're off to the races.
The weakness is that if one bypasses the build procedure, one can violate the constraint.
|