Veltro has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks,

I am a bit confused what happened, After installing cpanm DBD::mysql I accidentally typed in cpanm DBD instead of cpanm DBI. As far as I can see DBD is not an existing module (except that it contains a lot of sub-modules) but I got:

cpanm (App::cpanminus) 1.7043 on perl 5.026002 built for MSWin32-x64-m +ulti-thread Work directory is C:\Users\<my username>/.cpanm/work/1550942634.10904 You have make C:\Strawberry64\c\bin\gmake.exe You have LWP 6.34 Falling back to Archive::Tar 2.26 Searching DBD () on cpanmetadb ... --> Working on DBD Fetching http://www.cpan.org/authors/id/G/GM/GMPASSOS/HDB-1.05.tar.gz -> OK Unpacking HDB-1.05.tar.gz Entering HDB-1.05 ... ...

Luckily the installation failed because this is not what I intended, but I can't figure out why the installation of HDB started. So I like to know what happened?

Replies are listed 'Best First'.
Re: cpanm, entered non existing module by accident, but installation started
by haukex (Archbishop) on Feb 23, 2019 at 18:09 UTC

    When you use the MetaCPAN API to search for that module (https://fastapi.metacpan.org/v1/module/DBD) it returns the distribution HDB because its HDB::MOD package contains a package DBD, so the CPAN indexer picked that up. I think it probably would have been better if the module's author had set that up so that that package didn't get indexed, but that's the way it is at the moment.