Look at perldoc for "require" but I believe what you want is @INC in place of your @used. Hmm, maybe not % perl -E 'use strict; say for ( @INC );' /Library/Perl/5.34/darwin-thread-multi-2level /Library/Perl/5.34 /Network/Library/Perl/5.34/darwin-thread-multi-2level /Network/Library/Perl/5.34 /Library/Perl/Updates/5.34.1 /System/Library/Perl/5.34/darwin-thread-multi-2level /System/Library/Perl/5.34 /System/Library/Perl/Extras/5.34/darwin-thread-multi-2level /System/Library/Perl/Extras/5.34
On Tue, Oct 1, 2024 at 5:20 AM Luca Ferrari <fluca1...@gmail.com> wrote: > 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 > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk