PDL(3pm)

✨ NAME ✨

PDL β€” the Perl Data Language. that's it, that's the whole name, and honestly it's iconic πŸ’…

this is the PDL(3pm) page, btw β€” user-contributed perl docs, section 3, bestie πŸŽ€


🌸 SYNOPSIS 🌸

okay so here's the vibe, look at this lil guy go:

use PDL;
$x = zeroes 3,3; # 3x3 matrix
$y = $x + 0.1 * xvals($x) + 0.01 * yvals($x);
print $y;
print $y->slice(":,1");  # row 2
print $diag = $y->diagonal(0,1), "\n"; # 0 and 1 are the dimensions
$diag += 100;
print "AFTER, y=$y";
[
 [   0  0.1  0.2]
 [0.01 0.11 0.21]
 [0.02 0.12 0.22]
]
[
 [0.01 0.11 0.21]
]
[0 0.11 0.22]
AFTER, y=
[
 [   100    0.1    0.2]
 [  0.01 100.11   0.21]
 [  0.02   0.12 100.22]
]

like?? it just did all that. no loops. no crying. obsessed πŸ˜­πŸ’–


πŸ’œ DESCRIPTION πŸ’œ

(quick note bestie: for the exported PDL constructor, pdl(), go peek at PDL::Core ✨)

so. PDL is the Perl Data Language β€” a perl extension designed for scientific and bulk numeric data processing and display. it extends perl's syntax and includes fully vectorized, multidimensional array handling, plus several paths for device-independent graphics output. it's giving everything 🌈

and PDL is fast β€” comparable to, and often outperforming, IDL and MATLAB in real world applications. no cap πŸ”₯ PDL lets large N-dimensional data sets like big images, spectra, etc. be stored efficiently and manipulated quickly. main character energy fr fr πŸ‘‘


πŸ¦‹ VECTORIZATION πŸ¦‹

if you wanna read about the vectorization (also called "broadcasting"), go check out PDL::Core πŸ’«


πŸŽ€ INTERACTIVE SHELL πŸŽ€

the PDL package includes an interactive shell, and it's lowkey the bestie you didn't know you needed 🫢 you can learn about it by running perldoc perldl, or just run the shell perldl and type help.


πŸ’… LOOKING FOR A FUNCTION? πŸ’…

trying to find a function name? then babe you want the PDL shell plus the help or apropos command (that's the fuzzy search one, iykyk). for example:

pdl> apropos xval
xlinvals        X axis values between endpoints (see xvals).
xlogvals        X axis values logarithmicly spaced...
xvals           Fills an ndarray with X index values...
yvals           Fills an ndarray with Y index values. See the CAVEAT for xvals.
zvals           Fills an ndarray with Z index values. See the CAVEAT for xvals.

to learn more about the PDL shell, see perldl ✨


πŸ“š LANGUAGE DOCUMENTATION πŸ“š

most PDL documentation is about the language features. the number of PDL pages is way too great to list here, so the following pages offer some guidance to help you find the documentation you need 🧚

PDL::FAQ

frequently asked questions about PDL. this page covers a lot of questions that don't fall neatly into any of the documentation categories πŸ“

PDL::Tutorials

a guide to PDL's tutorial-style documentation. with topics from beginner to advanced, these pages teach you various aspects of PDL step by step πŸ’«

PDL::Modules

a guide to PDL's module reference. modules are organized by level (foundation to advanced) and by category (graphics, numerical methods, etc) to help you find the module you need as quickly as possible πŸ”

PDL::Course

this page compiles PDL's tutorial and reference pages into a comprehensive course that takes you from a complete beginner level to expert πŸ‘‘ literally the glow-up arc

PDL::Index

list of all available documentation, sorted alphabetically. if you cannot find what you are looking for, try here πŸƒβ€β™€οΈ

PDL::DeveloperGuide

a guide for people who want to contribute to PDL. contributions are very welcome! πŸ™ˆπŸ’–


🌈 DATA TYPES 🌈

PDL comes with support for most native numeric data types available in C. 2.027 added support for C99 complex numbers πŸ”₯ see PDL::Core, PDL::Ops and PDL::Math for details on usage and behaviour.


🧚 MODULES 🧚

PDL includes about a dozen perl modules that form the core of the language, plus additional modules that add further functionality. the perl module PDL loads all of the core modules automatically, making their functions available in the current perl namespace. some notes:

Modules loaded by default

use PDL; # Is equivalent to the following:

  use PDL::Core;
  use PDL::Ops;
  use PDL::Primitive;
  use PDL::Ufunc;
  use PDL::Basic;
  use PDL::Slices;
  use PDL::Bad;
  use PDL::MatrixOps;
  use PDL::Math;
  use PDL::IO::Misc;
  use PDL::IO::FITS;
  use PDL::IO::Pic;
  use PDL::IO::Storable;

PDL::Lite and PDL::LiteF

these are lighter-weight alternatives to the standard PDL module. consider using these modules if startup time becomes an issue ⏱️

note that PDL::Math and PDL::MatrixOps are not included in the PDL::Lite and PDL::LiteF start-up modules.

Exports

use PDL; exports a large number of routines into the calling namespace. if you want to avoid namespace pollution, you must instead use PDL::Lite, and include any additional modules explicitly 🧼✨

PDL::NiceSlice

note that the PDL::NiceSlice syntax is NOT automatically loaded by use PDL;. if you want to use the extended slicing syntax in a standalone script, you must also say use PDL::NiceSlice; πŸ’…


🫢 INTERNATIONALIZATION 🫢

PDL currently does not have internationalization support for its error messages, although Perl itself does support i18n and locales. some of the tests for names and strings are specific to ASCII and English. please report any issues regarding internationalization to the perldl mailing lists πŸ“¬

and of course, volunteers to implement this or help with the translations would be welcome 🌸 (not me volunteering you. okay maybe a little. 😭)


πŸ‘‘ INSTALLATION πŸ‘‘

see PDL::InstallGuide for help πŸ”§


and that's the whole page bestie! this was PDL(3pm) from the User Contributed Perl Documentation, generated with perl v5.42.3 and dated 2026-08-20 β€” go forth and vectorize, you absolute icon πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from