in reply to How to add path to @INC

However TryCatch is installed but in a path that is not in @INC, TryCatch is in ~/.cpan/build/TryCatch-1.003002-0KBiDH/lib!

As others have stated, it is not installed there - that is where it was built.
And, if any of the tests failed, then it won't be installed at all unless you use force:
cpan -fi TryCatch


Adding ~/.cpan/build/TryCatch-1.003002-0KBiDH/lib to @INC will probably not work.
It will enable TryCatch.pm to be found, but then the TryCatch loadable object (.so or .dll, depending upon platform) will not be found. For the loadable object to be found you probably need to also add ~/.cpan/build/TryCatch-1.003002-0KBiDH/blib/arch to @INC.
This assumes that ~/.cpan/build/TryCatch-1.003002-0KBiDH/blib/arch/auto/TryCatch/TryCatch.so (or .dll) exists, and this is not necessarily the case.
The existence of ~/.cpan/build/TryCatch-1.003002-0KBiDH/ indicates that an attempt to build and install TryCatch was made, but it doesn't tell us if it succeeded, or at what stage the process failed (if it did not succeed).

Could you please run:
cpan -i TryCatch
and post the output.

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: How to add path to @INC
by TSN (Acolyte) on May 21, 2016 at 01:24 UTC
      First problem occurs when building Scope::Upper (which is a TryCatch prerequisite):
      Upper.xs:1331:11: error: ‘CXt_LOOP_FOR’ undeclared (first use in this +function) case CXt_LOOP_FOR:
      Therefore Scope::Upper fails to build and does not get installed.
      Versions of perl prior to 5.24.0 define CXt_LOOP_FOR in cop.h, but not perl-5.24.0.
      But it's worse than that - see the bug report.
      That thread contains a patch which might solve your issue if you wish to apply it.

      TryCatch therefore fails its tests because Scope::Upper cannot be found.
      Therefore, TryCatch fails to install. You could force the installation but that won't help because TryCatch.pm needs to load Scope/Upper.pm and there's no way of installing a loadable Scope::Upper when it fails to build.

      I would take this up with the authors of these 2 modules.
      Does TryCatch *really* need to use Scope::Upper ?
      Maybe the Scope::Upper author would agree to upload a devel version of Scope::Upper that at least builds (despite his reservations about the mileage that would provide). It could be that the broken aspects of Scope::Upper don't impact on TryCatch.pm and it's just a matter of installing the patched version.

      Or you could consider using something else .... or revert to perl-5.22.x or earlier.

      Cheers,
      Rob
        That thread contains a patch which might solve your issue if you wish to apply it.
        That patch was just a work-in-progress proof of concept; I wouldn't recommend using it in production. I'm still working writing proper fixes for Scope::Upper.

        Dave.

        Thank you Rob

        I had a earlier version of Perl however I needed update it due to a software (CLUMPAK) that asks for modules that only work in Perl 5.24! Really everything worked fine in earlier version but in this one I have problems like that! Even more others modules have problems too:

        cpan[7]> install GraphViz Running install for module 'GraphViz' Checksum for /home/uce/.cpan/sources/authors/id/R/RS/RSAVAGE/GraphViz- +2.20.tgz ok Configuring R/RS/RSAVAGE/GraphViz-2.20.tgz with Build.PL Can't exec "dot": Ficheiro ou directoria inexistente at Build.PL line +14. Please install Graphviz from http://www.graphviz.org/. No 'Build' created RSAVAGE/GraphViz-2.20.tgz /usr/local/bin/perl Build.PL --installdirs site -- NOT OK Failed during this command: RSAVAGE/GraphViz-2.20.tgz : writemakefile NO -- No + 'Build' created

        or

        cpan[6]> install DB_File Running install for module 'DB_File' Checksum for /home/uce/.cpan/sources/authors/id/P/PM/PMQS/DB_File-1.83 +8.tar.gz ok Configuring P/PM/PMQS/DB_File-1.838.tar.gz with Makefile.PL Parsing config.in... Looks Good. Checking if your kit is complete... Looks good 'EXPATINCPATH' is not a known MakeMaker parameter name. 'EXPATLIBPATH' is not a known MakeMaker parameter name. Warning (mostly harmless): No library found for -ldb Generating a Unix-style Makefile Writing Makefile for DB_File Writing MYMETA.yml and MYMETA.json PMQS/DB_File-1.838.tar.gz /usr/local/bin/perl Makefile.PL EXPATLIBPATH=/non-standard/lib EXPAT +INCPATH=/non-standard/include -- OK Running make for P/PM/PMQS/DB_File-1.838.tar.gz cp DB_File.pm blib/lib/DB_File.pm Running Mkbootstrap for DB_File () chmod 644 "DB_File.bs" "/usr/local/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- DB_F +ile.bs blib/arch/auto/DB_File/DB_File.bs 644 cc -c -I/usr/local/BerkeleyDB/include -fwrapv -fno-strict-aliasing -p +ipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FIL +E_OFFSET_BITS=64 -O2 -DVERSION=\"1.838\" -DXS_VERSION=\"1.838\" -fP +IC "-I/usr/local/lib/perl5/5.24.0/x86_64-linux/CORE" -D_NOT_CORE -D +mDB_Prefix_t=size_t -DmDB_Hash_t=u_int32_t version.c version.c:30:16: fatal error: db.h: Ficheiro ou directoria inexistente #include <db.h> ^ compilation terminated. make: ** [version.o] Erro 1 PMQS/DB_File-1.838.tar.gz /usr/bin/make -- NOT OK Failed during this command: PMQS/DB_File-1.838.tar.gz : make NO

        summing up, all these modules required for Bio:SeIO fail

        cpan[5]> install Bio::SeqIO Running install for module 'Bio::SeqIO' Checksum for /home/uce/.cpan/sources/authors/id/C/CJ/CJFIELDS/BioPerl- +1.6.924.tar.gz ok Scanning cache /home/uce/.cpan/build for sizes ...................................................................... +......DONE Configuring C/CJ/CJFIELDS/BioPerl-1.6.924.tar.gz with Build.PL Checking prerequisites... recommends: * DB_File is not installed * GraphViz is not installed * SOAP::Lite is not installed Checking optional features... Bio::DB::GFF Tests....disabled requires: ! DBI is not installed DB_File Tests.........disabled requires: ! DB_File is not installed EntrezGene............disabled requires: ! Bio::ASN1::EntrezGene is not installed MySQL Tests...........disabled requires: ! DBD::mysql is not installed ! DBI is not installed Pg Tests..............disabled requires: ! DBD::Pg is not installed ! DBI is not installed SQLite Tests..........disabled requires: ! DBD::SQLite is not installed ! DBI is not installed ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the v +ersions of the modules indicated above before proceeding with this installatio +n Install [a]ll BioPerl scripts, [n]one, or choose groups [i]nteractivel +y? [a] ^CWarning: No success on command[/usr/local/bin/perl Build.PL +--installdirs site] CJFIELDS/BioPerl-1.6.924.tar.gz /usr/local/bin/perl Build.PL --installdirs site -- NOT OK Failed during this command: CJFIELDS/BioPerl-1.6.924.tar.gz : writemakefile NO '/usr +/local/bin/perl Build.PL --installdirs site' returned status 2

        However I installed BioPerl-1.6.924 (Bio::SeqIO) from "outside" (without cpan), after to adding the path at PERL5LIB, and it works just fine! When I run all tests everything sounds good!

        All tests successful. Files=334, Tests=21522, 120 wallclock secs ( 3.39 usr 0.47 sys + 107. +39 cusr 4.43 csys = 115.68 CPU) Result: PASS

        What you think about all this?

        Best, TSN