in reply to Accessing list of package names in a module

Just one remark for better understanding: Each imported package is listed in the namespace symbol table of the importing package.

so by scanning the namespaces starting from the root "main" you should find the desired infos. Packages are keys ending with a "::".

use Data::Dumper; print Dumper \%:: ;
you will see entries like 'Data::' => *{'::Data::'},

so recursively you can get all the infos you want.

Cheers LanX

UPDATE:

Note:

Replies are listed 'Best First'.
Re^2: Accessing list of package names in a module
by FreakyGreenLeaky (Sexton) on Nov 20, 2008 at 10:43 UTC
    Aah, that's the one. Nice and simple and takes advantage of goodies hidden internally . Thank you!
      Symbol tables are hardly "goodies hidden internally", they are documented in perlmod.

      Though if you come from other programming languages it's not obvious that something like that even exists :-)