http://www.perlmonks.org?node_id=1193034


in reply to System vs. User module version of List::Util

G'day Lady Aleena,

What you have installed locally ("from the command line") indicates Perl 5.24.1; however, whatever your ISP, or equivalent, has installed ("from the browser") indicates Perl 5.8.8.

As far as I know, the core List::Util module has never had the uniq function. Here's the online perldoc for the nearest versions I could find: List::Util (Perl 5.8.8 core) and List::Util (Perl 5.24.0 core) — note the absence of the uniq function in both of those.

When you install List::Util from CPAN, you're actually getting a bundle of modules. At the top of List::Util (CPAN) you'll see the link to the Scalar-List-Utils-1.47 distribution. Follow that to see the modules and other files; one of those is README which contains:

This distribution is a replacement for the builtin distribution.

This package contains a selection of subroutines that people have expressed would be nice to have in the perl core, but the usage would not really be high enough to warrant the use of a keyword, and the size so small such that being individual extensions would be wasteful.

The module which originally had (as best as I remember) the uniq function is List::MoreUtils. Rather than trying to manipulate @INC, you might be better off changing

use List::Util qw{uniq};

to

use List::MoreUtils qw{uniq};

Of course, that would require your ISP (or equivalent) to have List::MoreUtils installed.

"So I installed it in my user directory, and it is version 1.47. However, I am getting an error that uniq is not exported by List::Util."

It's possible I've missed the point there somewhere; in case I haven't, I'll just point out that modules added to the 5.24.1 installation will not make them available to the 5.8.8 installation.

— Ken