http://qs321.pair.com?node_id=817255


in reply to Conditionally faking a module

If you want to run some code if a module isn't installed, just test the use statement for failure:

eval "use Cava::Pack" or do { # your code goes here };

Super Search will find several threads on this topic, including Auto install of a perl package if 'use' statement fails.