-2

I have a problem when i compile my perl program : it mention :

Can't locate Bench.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at test.pl line 4. BEGIN failed--compilation aborted at test.pl line 4.

Any idea please? Thanks

user17241
  • 307
  • 1
  • 4
  • 16
  • 2
    Have you actually installed Bench? – Jenny D Mar 28 '13 at 11:06
  • From the [Stack Overflow Perl FAQ](http://stackoverflow.com/questions/tagged/perl?sort=frequent): [What's the easiest way to install a missing Perl module?](http://stackoverflow.com/questions/65865/whats-the-easiest-way-to-install-a-missing-perl-module) [How can I install a CPAN module into a local directory?](http://stackoverflow.com/questions/540640/how-can-i-install-a-cpan-module-into-a-local-directory) – daxim Mar 29 '13 at 11:10

2 Answers2

3

Install Bench as you would any other CPAN module, e.g. with cpanm, cpanp or cpan.

You might want to first use perlbrew to install a local (and newer) version of Perl so you won't be touching anything related to the system Perl installation.

daxim
  • 39,270
  • 4
  • 65
  • 132
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
1

First, check if you have installed Bench module:

%> perl -MBench -e 1

If you get the error message, you have to install it:

%> cpan Bench
daxim
  • 39,270
  • 4
  • 65
  • 132
Miguel Prz
  • 13,718
  • 29
  • 42
  • 1
    cpan install Bench It looks like you specified 'install' as an argument to cpan(1). This script is not the CPAN.pm prompt and doesn't understand the same commands. In fact, doesn't require the extra typing. You probably just want to list the modules you want to install: cpan Bench See the documentation for more details on using this script. – user17241 Mar 28 '13 at 11:16
  • 1
    try simply "cpan Bench" – Miguel Prz Mar 28 '13 at 11:26
  • Perhaps you should edit your answer to change it it to `cpan Bench` – Brad Gilbert Mar 28 '13 at 15:32