in reply to checking for all packages
I'd probably use the check_install() function from Module::Load::Conditional which is a core module.