iterate over the use-d modules

[email protected] (Luca Ferrari) Tue, 1 Oct 2024 12:20:09 +0200
Newsgroups perl.beginners
Message-ID <CAKoxK+40P3bfVaj6o+DizdU2mkKc4NhjH+2MEawYx7PbKhDKAA@mail.gmail.com>
Hi all,
is there a way to iterate over the used modules, I mean every symbol
loaded with use?
I would like to do something like:

use Foo;
use Bar;

say ${ $_ }::VERSION for ( @used );

and get something like

say $Foo::VERSION;
say $Bar::VERSION;


Thanks,
Luca