<s>
Perl	B-Language
Data	I-Language
Language	I-Language
(	O
abbreviated	O
PDL	O
)	O
is	O
a	O
set	O
of	O
free	B-Application
software	I-Application
array	B-Application
programming	I-Application
extensions	O
to	O
the	O
Perl	B-Language
programming	I-Language
language	I-Language
.	O
</s>
<s>
PDL	O
extends	O
the	O
data	O
structures	O
built	O
into	O
Perl	B-Language
,	O
to	O
include	O
large	O
multidimensional	B-Data_Structure
arrays	I-Data_Structure
,	O
and	O
adds	O
functionality	O
to	O
manipulate	O
those	O
arrays	O
as	O
vector	O
objects	O
.	O
</s>
<s>
It	O
also	O
provides	O
tools	O
for	O
image	B-Algorithm
processing	I-Algorithm
,	O
machine	O
learning	O
,	O
computer	B-Application
modeling	I-Application
of	O
physical	O
systems	O
,	O
and	O
graphical	O
plotting	O
and	O
presentation	O
.	O
</s>
<s>
Simple	O
operations	O
are	O
automatically	O
vectorized	O
across	O
complete	O
arrays	O
,	O
and	O
higher-dimensional	O
operations	O
(	O
such	O
as	O
matrix	B-Architecture
multiplication	O
)	O
are	O
supported	O
.	O
</s>
<s>
PDL	O
is	O
a	O
vectorized	O
array	B-Application
programming	I-Application
language	I-Application
:	O
the	O
expression	O
syntax	O
is	O
a	O
variation	O
on	O
standard	O
mathematical	O
vector	O
notation	O
,	O
so	O
that	O
the	O
user	O
can	O
combine	O
and	O
operate	O
on	O
large	O
arrays	O
with	O
simple	O
expressions	O
.	O
</s>
<s>
In	O
this	O
respect	O
,	O
PDL	O
follows	O
in	O
the	O
footsteps	O
of	O
the	O
APL	B-Language
programming	I-Language
language	I-Language
,	O
and	O
it	O
has	O
been	O
compared	O
to	O
commercial	O
languages	O
such	O
as	O
MATLAB	B-Language
and	O
Interactive	B-Language
Data	I-Language
Language	I-Language
,	O
and	O
to	O
other	O
free	O
languages	O
such	O
as	O
NumPy	B-Application
and	O
Octave	O
.	O
</s>
<s>
Unlike	O
MATLAB	B-Language
and	O
IDL	B-Language
,	O
PDL	O
allows	O
great	O
flexibility	O
in	O
indexing	O
and	O
vectorization	O
:	O
for	O
example	O
,	O
if	O
a	O
subroutine	O
normally	O
operates	O
on	O
a	O
2-D	O
matrix	B-Architecture
array	B-Application
,	O
passing	O
it	O
a	O
3-D	O
data	B-Algorithm
cube	I-Algorithm
will	O
generally	O
cause	O
the	O
same	O
operation	O
to	O
happen	O
to	O
each	O
2-D	O
layer	O
of	O
the	O
cube	O
.	O
</s>
<s>
PDL	O
borrows	O
from	O
Perl	B-Language
at	O
least	O
three	O
basic	O
types	O
of	O
program	O
structure	O
:	O
imperative	B-Application
programming	I-Application
,	O
functional	B-Language
programming	I-Language
,	O
and	O
pipeline	B-Operating_System
programming	I-Operating_System
forms	O
may	O
be	O
combined	O
.	O
</s>
<s>
Subroutines	O
may	O
be	O
loaded	O
either	O
via	O
a	O
built-in	O
autoload	O
mechanism	O
or	O
via	O
the	O
usual	O
Perl	B-Language
module	O
mechanism	O
.	O
</s>
<s>
True	O
to	O
the	O
glue	O
language	O
roots	O
of	O
Perl	B-Language
,	O
PDL	O
borrows	O
from	O
several	O
different	O
modules	O
for	O
graphics	O
and	O
plotting	O
support	O
.	O
</s>
<s>
NetPBM	B-Language
provides	O
image	O
file	O
I/O	O
(	O
though	O
FITS	O
is	O
supported	O
natively	O
)	O
.	O
</s>
<s>
Gnuplot	B-Application
,	O
PLplot	B-Language
,	O
PGPLOT	B-Library
,	O
and	O
Prima	O
modules	O
are	O
supported	O
for	O
2-D	O
graphics	O
and	O
plotting	O
applications	O
,	O
and	O
Gnuplot	B-Application
and	O
OpenGL	B-Application
are	O
supported	O
for	O
3-D	O
plotting	O
and	O
rendering	O
.	O
</s>
<s>
PDL	O
provides	O
facilities	O
to	O
read	O
and	O
write	O
many	O
open	O
data	O
formats	O
,	O
including	O
JPEG	O
,	O
PNG	O
,	O
GIF	O
,	O
PPM	O
,	O
MPEG	O
,	O
FITS	O
,	O
NetCDF	B-Application
,	O
GRIB	B-Application
,	O
raw	O
binary	O
files	O
,	O
and	O
delimited	O
ASCII	O
tables	O
.	O
</s>
<s>
PDL	O
programmers	O
can	O
use	O
the	O
CPAN	B-Language
Perl	B-Language
I/O	O
libraries	O
to	O
read	O
and	O
write	O
data	O
in	O
hundreds	O
of	O
standard	O
and	O
niche	O
file	O
formats	O
.	O
</s>
<s>
It	O
includes	O
modules	O
that	O
are	O
used	O
to	O
perform	O
classic	O
k-means	B-Algorithm
clustering	I-Algorithm
or	O
general	O
and	O
generalized	O
linear	O
modeling	O
methods	O
such	O
as	O
ANOVA	O
,	O
linear	O
regression	O
,	O
PCA	O
,	O
and	O
logistic	O
regression	O
.	O
</s>
<s>
An	O
installation	O
of	O
PDL	O
usually	O
comes	O
with	O
an	O
interactive	O
shell	B-Operating_System
known	O
as	O
perldl	B-Language
,	O
which	O
can	O
be	O
used	O
to	O
perform	O
simple	O
calculations	O
without	O
requiring	O
the	O
user	O
to	O
create	O
a	O
Perl	B-Language
program	O
file	O
.	O
</s>
<s>
A	O
typical	O
session	O
of	O
perldl	B-Language
would	O
look	O
something	O
like	O
the	O
following	O
:	O
</s>
<s>
The	O
commands	O
used	O
in	O
the	O
shell	B-Operating_System
are	O
Perl	B-Language
statements	O
that	O
can	O
be	O
used	O
in	O
a	O
program	O
with	O
PDL	O
module	O
included	O
.	O
</s>
<s>
x	O
is	O
an	O
overloaded	O
operator	O
for	O
matrix	B-Architecture
multiplication	O
,	O
and	O
p	O
in	O
the	O
last	O
command	O
is	O
a	O
shortcut	O
for	O
print	O
.	O
</s>
<s>
The	O
core	O
of	O
PDL	O
is	O
written	O
in	O
C	B-Language
.	O
Most	O
of	O
the	O
functionality	O
is	O
written	O
in	O
PP	O
,	O
a	O
PDL-specific	O
metalanguage	O
that	O
handles	O
the	O
vectorization	O
of	O
simple	O
C	B-Language
snippets	O
and	O
interfaces	O
them	O
with	O
the	O
Perl	B-Language
host	O
language	O
via	O
Perl	B-Language
's	O
XS	B-Language
compiler	O
.	O
</s>
<s>
Some	O
modules	O
are	O
written	O
in	O
Fortran	B-Application
,	O
with	O
a	O
C/PP	O
interface	O
layer	O
.	O
</s>
<s>
PP	O
is	O
available	O
to	O
the	O
user	O
to	O
write	O
C-language	O
extensions	O
to	O
PDL	O
.	O
</s>
<s>
There	O
is	O
also	O
an	O
Inline	O
module	O
(	O
Inline::Pdlpp	O
)	O
that	O
allows	O
PP	O
function	O
definitions	O
to	O
be	O
inserted	O
directly	O
into	O
a	O
Perl	B-Language
script	O
;	O
the	O
relevant	O
code	O
is	O
low-level	O
compiled	O
and	O
made	O
available	O
as	O
a	O
Perl	B-Language
subroutine	O
.	O
</s>
<s>
The	O
PDL	O
API	O
uses	O
the	O
basic	O
Perl	B-Language
5	O
object-oriented	O
functionality	O
:	O
PDL	O
defines	O
a	O
new	O
type	O
of	O
Perl	B-Language
scalar	O
object	O
(	O
eponymously	O
called	O
a	O
"	O
PDL	O
"	O
,	O
or	O
"	O
ndarray	O
"	O
)	O
that	O
acts	O
as	O
a	O
Perl	B-Language
scalar	O
,	O
but	O
that	O
contains	O
a	O
conventional	O
typed	O
array	B-Application
of	O
numeric	O
or	O
character	O
values	O
.	O
</s>
<s>
All	O
of	O
the	O
standard	O
Perl	B-Language
operators	O
are	O
overloaded	O
so	O
that	O
they	O
can	O
be	O
used	O
on	O
PDL	O
objects	O
transparently	O
,	O
and	O
PDLs	O
can	O
be	O
mixed-and-matched	O
with	O
normal	O
Perl	B-Language
scalars	O
.	O
</s>
