The program 'perldl' is a simple shell (written in perl) for interactive use of PDL. perl/PDL commands can simply be typed in - and edited if you have appropriate version of the ReadLines and ReadKeys modules installed.
e.g.:
% perldl ReadLines enabled perldl> $a = rfits "foo.fits" BITPIX = -32 size = 88504 pixels Reading 354016 bytes BSCALE = && BZERO = perldl> imag log($a+400) Displaying 299 x 296 image from 4.6939525604248 to 9.67116928100586 ...
Miscellaneous shell features:
The command perldl -oo starts perldl in Object-Oriented mode. It does a 'use PDL::OO' instead of 'use PDL'. Whether this is a good idea remains to be determined. :-)
perldl -oo
use PDL::OO
use PDL
The shell aliases p to be a convenient short form of print, e.g.
p
print
perldl> p ones 5,3 [ [1 1 1 1 1] [1 1 1 1 1] [1 1 1 1 1] ]
The files ~/.perldlrc and local.perldlrc (in the current directory) are sourced if found. This allows the user to have global and local PDL code for startup.
~/.perldlrc
local.perldlrc
Any line starting with the # character is treated as a shell escape. This character is configurable by setting the perl variable $PERLDL_ESCAPE. This could, for example, be set in ~/.perldlrc.
#
To install PDL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PDL
CPAN shell
perl -MCPAN -e shell install PDL
For more information on module installation, please visit the detailed CPAN module installation guide.