If you are looking to a similar apt/dpkg function, I don't know one, but you can use this:
dpkg -S $(cpan -D Net::Cmd | grep pm | awk -F '/' '{print $NF}')
perl-modules: /usr/share/perl/5.14.2/IPC/Cmd.pm
perl-modules: /usr/share/perl/5.14.2/Net/Cmd.pm
You can use cpan -D module
to find basic information about a module:
cpan -D Net::Cmd
Going to read '/home/braiam/.cpan/Metadata'
Database was generated on Fri, 16 Aug 2013 21:53:02 GMT
Net::Cmd
-------------------------------------------------------------------------
For command based protocols (FTP, SMTP etc)
S/SH/SHAY/libnet-1.23.tar.gz
/usr/share/perl/5.14/Net/Cmd.pm
Installed: 2.29
CPAN: 2.30 Not up to date
Graham Barr (GBARR)
gbarr@pobox.com
Then parse the module path, in my case I was lazy, you can use whatever you like to do this:
cpan -D Net::Cmd | grep pm | awk -F '/' '{print $NF}'
Cmd.pm
Then use command substitution:
dpkg -S $(cpan -D Net::Cmd | grep pm | awk -F '/' '{print $NF}')
perl-modules: /usr/share/perl/5.14.2/IPC/Cmd.pm
perl-modules: /usr/share/perl/5.14.2/Net/Cmd.pm
Hope is useful to you. BTW, this requires cpan installed (which is in most of the defaults installations).
perl(Foo::Bar)
mean? Is that a Perl package? – Ken Kinder Feb 29 '12 at 20:46yum
functionality and has nothing whatsoever to do with my question. Had I asked about something that provides a particular file by path, your assumption would be correct, though. Same for the linked SO-question - completely unrelated. – 0xC0000022L Aug 16 '13 at 21:03apt-file
specifies the package associated with the file, so it is a close answer. For example, ifBaz.pm
is provided bybaz-perl
, this package will appear on the output. I don't think there is an APT command for specifying aperl
module in the way you want, though. Looks like a convenience too convenient. I think this question is better suited to [unix.se]. – edwin Aug 16 '13 at 21:25yum
)apt-file
doesn't even allow/support wildcards. So aside from the problem to guess the names (not too difficult with Perl-only modules), I need to give a full path. But probably it's at least a workaround. Thanks! (i.e.apt-file list '*/DBI/SQL/Nano.pm'
doesn't, butapt-file list /usr/lib/perl5/DBI/SQL/Nano.pm
does give a result ... if you get my drift :)) – 0xC0000022L Aug 16 '13 at 22:56apt-file search Nano.pm
. – edwin Aug 17 '13 at 00:19