in reply to how do you determine which module needs to be updated while using perlbrew?

I've just installed v5.42.0 via Perlbrew using the commands shown under Quickstart:

To install the latest stable release ...

perlbrew install perl-5.42.0 perlbrew switch perl-5.42.0

I'm guessing your "perlbrew install stable" would achieve the same result.

I've also installed a number of modules, via the cpan utility, including namespace::clean. I repeated your commands:

ken@titan ~/tmp $ perl -E 'use namespace::clean' ken@titan ~/tmp $ perl -v This is perl 5, version 42, subversion 0 (v5.42.0) built for cygwin-th +read-multi Copyright 1987-2025, Larry Wall ...

So, there's nothing inherently wrong with the perl-5.42.0 from Perlbrew. I acknowledge that you're using Linux and I'm using Cygwin — for test commands as simple as the ones above, I don't believe this would make any difference.

It is a fairly common mistake to copy modules from one Perl version to another; for instance, I might have tried:

ken@titan ~/perl5/perlbrew/perls $ cp perl-5.40.0/lib/site_perl/5.40.0/namespace/clean.pm perl-5.42.0/l +ib/site_perl/5.42.0/namespace/clean.pm

Had I done so, I could have expected an error such as you're getting. I don't know if this is what you've done but your results are suggesting something like this has occurred. Here's some basic information:

I note ibm1620 suggested clone-modules. I've never used that but it may suit your needs. See perlbrew: COMMAND: CLONE-MODULES for documentation.

Finally, please consider registering — see Create A New User. You won't be asked for your life story like some forums; we'll be able to tell you apart from other Anonymous Monks; and, you'll find quite a few benefits such as editing your posts, customising the GUI, and others.

— Ken