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
- ubuntu stonking: pdl 1:2.106-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms