I want to export only the pdl()
function from PDL
to avoid namespace collision with other automatically exported functions such as max
, median
, sum
, intersect
etc. However, when I tried
use PDL qw(pdl);
it doesn't work as the aforementioned functions still get exported (and I get warnings on functions being redefined).
On the other hand, if I do
use PDL qw();
The collision doesn't happen. But when I try to use the pdl()
function in the program via PDL::pdl()
, it fails with this error message:
Can't call method "new" on unblessed reference at Basic/Core/Core.pm.PL (i.e. PDL::Core.pm) line 934.
Also, I tried inside the script
{
require PDL;
pdl();
}
I get the same error message.
Can someone advice on how I can export pdl() only? Thx!
I guess if you only import PDL::Core, you'll get only the functions in this module.