perlpdl

Difference between PDL::Core and PDL::Core ':Internal'


I just started using PDL and saw in the documentation that there are 2 possible ways of importing PDL's core function:

use PDL::Core;
use PDL::Core ':Internal';

What exactly is the difference here? The documentation makes a comment on the second method: "Hairy routines". I also could not find anything about what's meant by that.


Solution

  • use PDL::Core;
    

    is equivalent to

    use PDL::Core ':Func';
    

    which is equivalent to

    use PDL::Core
       qw( piddle pdl null barf ),
       ( map $_->convertfunc, PDL::Types::types() ),
       qw(
          nelem dims shape null empty dup dupN inflateN
          convert inplace zeroes zeros ones nan inf i list listindices unpdl
          set at flows broadcast_define over reshape dog cat barf type
          thread_define dummy mslice approx flat sclr squeeze
          get_autopthread_targ set_autopthread_targ get_autopthread_actual
          get_autopthread_dim get_autopthread_size set_autopthread_size
       );
    

    use PDL::Core ':Internal';
    

    is equivalent to

    use PDL::Core qw( howbig broadcastids topdl );