in reply to perlcritic on Linux
Welcome to Perl and the Monastery, ymakkapati.
Based on those paths, it sounds like you're trying to install a module into the system Perl using cpan, which is generally not recommended, because it can create conflicts with the packages installed into the system Perl using the package manager, and in case of problems, cleaning this up can become quite difficult. Also, Perl modules should always be installed using their recommended installation procedure, not by copying files into the @INC directories.
Although I am not a CentOS expert (hippo is our resident expert, I believe), I think you should be able to install Perl::Critic (which includes the perlcritic command) by installing the RPM package perl-Perl-Critic using your system's package manager, and I'd also install perl-core to get all the Perl core modules installed as well. Assuming the RPM's dependencies are configured correctly, you should get all the required dependencies installed automatically as well.
If you don't want to modify the system Perl, then the recommended alternatives are: You can install a copy of Perl into your home directory using e.g. perlbrew, into which you can install any CPAN modules you like using cpanm (which I'd recommend) or cpan. The other alternative is local::lib, which lets you install modules to your home directory, but still allows you to use the system Perl (I believe the RPM package for that is perl-local-lib).
By the way, you said "I ... tried to run ./perlcritic". That probably won't work, since the ./ means "run the executable that is in the current directory", which won't find the perlcritic installed in your PATH - you should run the command as simply "perlcritic" (without the ./).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perlcritic on Linux
by ymakkapati (Initiate) on Apr 11, 2019 at 19:28 UTC |