| Perl Data Language |
Article Index for Perl |
Website Links For Perl |
Information AboutPerl Data Language |
| CATEGORIES ABOUT PERL DATA LANGUAGE | |
| array programming languages | |
| numerical programming languages | |
| perl modules | |
|
PDL is an extension to for type conversion, variable size, and the like. Numerical tasks such as Image Processing and Computer Model ing of physical systems require more structured data, and PDL supplies this need by including more traditional Array constructs. On a computer with both Perl and PDL installed, any Perl script can use the PDL functionality by declaring "use PDL;". Like Perl, PDL is Free Software . LANGUAGE DESIGN PDL is a vectorized array, passing it a 3-D Data Cube will generally cause the same operation to happen to each 2-D layer of the cube. PDL borrows from perl all three basic types of program structure: Imperative Programming , Functional Programming , and Pipeline Programming forms may be combined. Subroutines may be loaded either via a built-in Autoload mechanism or via the usual Perl module mechanism. As of early 2005, PDL-like functionality is being included in the Perl 6 language design. GRAPHICS True to the Glue Language roots of Perl, PDL borrows from several different modules for graphics and plotting support. NetPBM provides image file I/O (though FITS is supported natively). PLPlot , PGPLOT , and Karma modules are all supported for 2-D graphics and plotting applications, and an interface to GL is available for 3-D plotting and rendering. I/O PDL provides facilities to read and write many open data formats, including JPEG , PNG , GIF , PPM , MPEG , FITS , NetCDF , GRIB , raw binary files, and delimited ASCII tables. Because of legal threats from Kodak , the owners of IDL , PDL cannot read or write IDL data files. PERLDL An installation of PDL usually comes with an interactive Shell known as perldl, which can be used to perform simple calculations without requiring to create a perl program file. A typical session of perldl would look something like the following: perldl> = pdl class="copylinks">1, 2 , [3, 4 ; perldl> = pdl class="copylinks">5, 6, 7 , [8, 9, 0 ; perldl> = x ; perldl> p ; [ 24 7 54 21 ] The commands used in the shell are perl statements that can be used in a program with PDL module included. x is an overloaded operator for matrix multiplication, and '''p''' in the last command is a shortcut for '''print'''.IMPLEMENTATION The core of PDL is written in C . Most of the functionality is written in PP, a PDL-specific metalanguage that handles the vectorization of simple C snippets and interfaces them with the perl host language via Perl's XS compiler. Some modules are written in FORTRAN , with a C/PP interface layer. Many of the supplied functions are written in PDL itself. PP is available to the user to write C-language extensions to PDL. The PDL API uses the basic Perl 5 object-oriented functionality: PDL defines a new type of perl scalar object ( Eponymously called a "PDL") that acts as a Perl scalar, but that contains a conventional Typed Array of numeric or character values. All of the standard Perl operators are overloaded so that they can be used on PDL objects transparently, and PDLs can be mixed-and-matched with normal Perl scalars. Several hundred object methods for operating on PDLs are supplied by the core modules. EXTERNAL LINKS
|
|
|