Hi Guys,
Suppose the module AAA::BBB::CCC
located in ~/modules/AAA/BBB/CCC.pm
,
and "~/modules
" is in @INC
, so why the following code doesn't work and lead to compile error?
$class = "AAA::BBB" ;
$type = "CCC";
require $class . '::' . $type ;
I try to use require AAA::BBB::CCC
instead, it works . If I do need dynamically require a module by combining strings together rather than hardcode the module name directly, how should I do ?
thanks