PERL - HowTo's

mail

How to check whether a library is installed ?

method 1 :

  1. from the system shell cAsE SeNsItIvE !!! :
    cpan URI::telnet
  2. will return :
    • if this module is installed :
      URI::telnet is up to date (undef).
    • otherwise, it will try to install it :
      • on success, this will end on :
        /usr/bin/make install -- OK
      • otherwise :
        Warning: Cannot install URI::Telnet, don't know what it is.
        Try the command
        
        	i /URI::Telnet/		mind the capital "t"
        
        to find objects with matching identifiers.

method 2 :

Considering we're looking for the URI::telnet library, run :
  • find $(perl -e 'print "@INC"') -iname 'telnet.pm' | grep -i 'uri/'
  • or : find $(perl -V | egrep "/site_perl/[0-9]\.[0-9]\.[0-9]$" | sort -r | head -n 1) -iname 'telnet.pm' | grep -i 'uri/'

method 3 :

perl -e 'use IO::socket'
No error message means the module is installed.