D7: How do you get the name of a module?
You can use the system_rebuild_module_data() function to get a list of all module data in the system:

$module_list = system_rebuild_module_data();


Each entry in the array returned from that function contains all the details about the module, e.g.:



It's the same function used by the system modules admin page so I think it's safe to assume this is the best way to get this particular data.