are you asking about what modules the program has loaded?
Then add just before MasterServer::run(); this line: use Data::Dumper; print Dumper(\%INC); . The (hashtable) variable %INC holds all the names of loaded packages (actually base-filenames) and their location on disk. Not to be confused with @INC which is the modules search path when loading modules by using use ... . Dumper() is a useful function for your purposes, it dumps the contents of complex variables, like hashtables. But it takes references to these variables (i.e. the use of \ in Dumper(\%INC))
Alternatively, find where the implementation of the method MasterServer::load_recursive is located (hint: it most likely is in a file called MasterServer.pm) and inject some print statements to see what's going on during execution.
Be warned that at various stages you may encounter an error message saying that a module, a package can not be found. That can actually be one of two problems: 1) this package does not exist in your system or 2) it does exist but perl can not find it because it is not in the @INC search path. Fix #1 by installing said module, like using a package manager (which you can install by cpan App::cpanminus;) using cpanm MyModule::XYZ or the already installed package manager cpan MyModule::XYZ . Fix #2 by adding more search-path-names to @INC, for example by adding use lib 'a-path-name'; at the beginning of your script.
By using print and print Dumper(\$some-variable) at strategic places in the script one will be able to get a sense of the code flow.
Also, in case you can't run this script and you are on a Unix/Linux system: find . -type f -iname '*.pm' will list all files ending in .pm or .PM in current dir and all its sub-dirs. If you can't run the program, getting the flow code is an exercise in meditation and zen.
edit: btw, there may be already a flag, a variable which turns logging and printing debugging messages ON. Keep an eye in case there is one.
edit: fixed a type in use Data::DumpER thanks to haukex
bw, bliako
In reply to Re^3: Code Flow
by bliako
in thread Code Flow
by CougarXR7
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |