Most venerable monks i have a question for you.
I am working on legacy code and they used lib files to house all of their functions. The coder uses require to load the function.
What is the best way to debug these?
Here is snippet of their code
The run.pl sets up the environment and then the Currency.pl runs. --
/jet/prod/run.pl /jet/prod/Currency.pl
relavant piece of /jet/prod/Currency.pl
require "$mainProcDir/lib/getCurrencyOrderFiles.lib";
# MAIN PROCESSING SUBROUTINE
%mainVars;
$mainVars = \%mainVars;
main($msgLVL);
the main function of lib/getCurrencyOrderFiles.lib
sub main
{
my ($msgLVL) = @_;
my $sub = 'main';
print "-- Beginning [$sub]\n" if $msgLVL > 1;
getInitParms($msgLVL);
my @files = getFiles($msgLVL);
#
# my @files = ("chi_Currency_20130828*.txt");
for my $file (@files) {
print "\t FILE -> $file\n" if $msgLVL > 1;
moveFile($msgLVL,$file);
stageExtTblFiles($msgLVL,$file);
my $batch_id = loadOrders($msgLVL);
archiveFiles($msgLVL, $batch_id);
}
print "-- Leaving [$sub]\n" if $msgLVL > 1;
}