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.
In reply to Re: Conditionally faking a module
by bobf
in thread Conditionally faking a module
by wanna_code_perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |