Does anyone know of a way to iterate, at Perl run time, through all packages that have actually been included (i.e. use
'd or require
'd) in a Perl program? I have found lots of answers regarding how to find all installed packages, but that's not what I'm interested in. I specifically want to get a list of only those packages that the program has actually included. Is this possible at all?
I'm using Perl 5.26.0, by the way.
The hash %INC
contains all the loaded packages, see perlvar.
print "$_\n" for keys %INC;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With