in reply to script to check modules exist...

That is called a Makefile.PL, see Module::Install - Standalone, extensible Perl module installer