I wanted to be able to do this in Perl (the code below is Python lol)
try: import Module except: print \"You need module Module to run this program.\" >
use strict; use warnings; use Module;
If you don't have Module installed, you will get the error "Can't locate Module.pm in @INC (@INC contains: ...)." which is understandable enough.
Is there some particular reason you want/need a more specific message?