Forum Moderators: coopster & phranque

Message Too Old, No Replies

Dumb question about location a perl module

         

runner

5:13 pm on Jun 28, 2005 (gmt 0)

10+ Year Member



How do you tell what CPAN file you need to download to get a particular module? For instance, I need to install CGI::XHTML_DTD but there is no module in the CPAN module list with this name. I assume it's a subset of a different module but I don't know how to find out which one. Is there some easy way to figure this out?

I went to search.cpan.org and typed in the string "CGI::XHTML_DTD" and I got a bunch of results but I still couldn't tell which CPAN file I needed to download. I must be missing something because it can't be this difficult.

wruppert

4:28 am on Jun 29, 2005 (gmt 0)

10+ Year Member



That is a constant defined in the CGI module itself. On my machine it says

use constant XHTML_DTD => ['-//W3C//DTD XHTML 1.0 Transitional//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'];

The semi-standard is that module names are mixed case, variables are lower case and constants are all upper case. So CGI::Application is a module, while CGI::XXX_ZZZ or CGI::thevalue would be in the CGI module itself.

ckarg

8:11 am on Jun 29, 2005 (gmt 0)

10+ Year Member



You can always poke around on search.cpan.org.

If as in your case you're searching for a constant defined in a module, rather than a module, the list of search results should still list the right module. And it will certainly if you remove the trailing CAPITALISED part (along with the last '::' ).

For quick questions like yours, I've also found the IRC #perl channel to work quite well.