in reply to error handling by pm initialization

You'll find some info on how to load a module under conditions on the if doc. Also, the use manpage tells you that use is equivalent to:  BEGIN { require Module; Module->import( LIST ); } Where require include the files, and import imports the symbols into the current namespace. You can run your require in eval to see if it succeeds or fails (for any reason):

my $ModuleIsLoaded; BEGIN { $ModuleIsLoaded = eval "require Module; 1"; }

Replies are listed 'Best First'.
Re^2: error handling by pm initialization
by homeveg (Acolyte) on Dec 13, 2016 at 13:44 UTC
    Thanks for solution and links!