Suppose a program consists of the modules Spectra, Spc and Util. In this case all symbols can be written to an output file by:
no strict 'refs'; open FH, ">symbols.lis"; foreach my $mod ( qw(main Spectra Spc Util)) { foreach my $key (keys %{ "main::" . $mod . "::"}) { print FH ${ "main::" . $mod . "::"}{$key} . "\n"; } } close FH;