RECENT POSTS

P5-class-load

May 26, 2018

Working (require Class::Name) and more

require EXPR only accepts Class/Name.pm style module names, not ClassName. How frustrating! For that, we provide load_class ‘ClassName’. It’s often useful to test whether a module can be loaded, instead of throwing an error when it’s not available. For that, we provide try_load_class ‘ClassName’. Finally, sometimes we need to know whether a particular class has been loaded. Asking INC is an option, but that will miss inner packages and any class for which the filename does not correspond to the package name. For that, we provide is_class_loaded ‘ClassName’.

WWW https//metacpan.org/pod/ClassLoad