in reply to "Cannot find location"

G'day natol44,

Whatever Perl you're using for your browser script is not the same as the one you used when installing Digest::MD5::File.

If you run these two, you'll see different @INC lists:

/path/to/browser/perl -V /path/to/root/perl -V

You should install Digest::MD5::File using the /path/to/browser/perl environment.

Consider whether you should be modifying the 'root' Perl at all. Doing so is generally a bad idea. I don't know what OS you're using; however, the 'root' Perl is typically part of the OS and often has specific patches such that it works in a way expected by the OS. Adding a new module may seem harmless enough, but it might have dependencies which may be automatically installed, overwriting the version expected by the OS. Take a look at Perlbrew as an alternative way of handling this.

The lib pragma failed due to incorrect usage: it does not take paths to modules as arguments - see the linked doco for details. Using this pragma is just a band-aid solution which I don't recommend: if you go down this path, you'll likely end up with multiple 'use lib ...' statements, in multiple scripts, and a potential maintenance nightmare. Install the module correctly once - do nothing else!

— Ken

Replies are listed 'Best First'.
Re^2: "Cannot find location"
by haukex (Archbishop) on Apr 01, 2017 at 12:19 UTC
    Whatever Perl you're using for your browser script is not the same as the one you used when installing Digest::MD5::File.

    Not necessarily, /root/perl5/lib/perl5 makes it look like OP used local::lib under root to install the module. shmem already noted some of the problems with that, although I agree with your advice not to modify the system Perl, at least not with cpan or cpanm - using the system's package manager is usually okay.