I tried to check if XML::Simple is installed in my system or not.
perl -e 'while (<@INC>) { while (<$_/*.pm>) { print "$_\n"; } }'
The above one-liner was used for listing all modules installed in my system. However, it is not listing XML modules.
However, the following executes fine.
perl -e "use XML::Simple "
What might be the issue?
Check installed perl modules via terminal Available commands are: l - List all installed modules m <module> - Select a module q - Quit the program cmd? Then type l to list all the installed modules, you can also use command m <module> to select the module and get its information. After finish, just type q to quit.
Type perl -v on a command line to find out which version. ActiveState Perl has binary distributions of Perl for many platforms. This is the simplest way to install the latest version of Perl.
If the module is not installed, then: $ perl -e 'use dbi' Can't locate dbi.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14. 2 /usr/local/share/perl/5.14. 2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .)
You can check for a module's installation path by:
perldoc -l XML::Simple
The problem with your one-liner is that, it is not recursively traversing directories/sub-directories. Hence, you get only pragmatic module names as output.
Quick and dirty:
$ perl -MXML::Simple -e 1
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