in reply to finding all modules used from a script
The keys in the hash will be in the form Foo/Bar.pm, but you can fix that with a simple regex. Then you can do your cleanup. For example:
for my $file (keys %INC) { (my $class = $file) =~ s!/!::!g; $class =~ s/\.pm$//; if ($class->can('clean_up')) { $class->clean_up; } }
|
|---|