IDL(3pm)
π PDL::IO::IDL β reading + writing IDL(tm) save files β¨
Okay bestie, settle in, because this is the PDL::IO::IDL page and she is iconic. π
πΈ DESCRIPTION πΈ
PDL::IO::IDL lets you read and write IDL(tm) data files. That's the whole vibe.
But lowkey, rn only reading is implemented. Scalars, arrays, and structures? All supported, all slaying. Heap pointers, compiled code, and objects? Not supported. And out of those three, only heap pointers are likely to get support in the future β the other two are just... not on the agenda, periodt. π
Also, important: this code was not developed by RSI, the makers of IDL. Just so we're clear. π«Ά
β¨ NOTES β¨
π¦ these things seem to work (and we love that for them)
- BYTE, SHORT, LONG, FLOAT, and DOUBLE numeric types and arrays β all of these types seem to work fine. The matching variable gets stored as a PDL inside the hash element whose name is the same as the original variable in the file. Arrays get byteswapped as needed, and they're read in so that the dim list has the same indexing order within PDL as it did within IDL. no cap. β
- STRINGs and arrays of STRINGs β string types are stored as Perl list refs, sitting in the hash element with the same name as the original variable in the file. πΈ
- Structures β stored as hash refs. The elements of the hash can be accessed as values within the hash. π
- Common blocks β variables that are notated as being in a common block are read as normal. Common-block names get collected in the special hash value
'+common', which contains a hash where each keyword is the name of a common block and each value is an array of variable names. π
π these things are known to be not working and may one day be fixed
- COMPLEX numbers β these could be implemented as 2-arrays or as
PDL::Complexvalues, but aren't yet. π - PTR types β these could be implemented as perl refs but currently aren't. π
- writing β maybe one day. but why bother writing a broken file format? NetCDF is better. π₯
π these things are known to be not working and will probably never be fixed
- Compiled code β decompiling IDL code is a violation of the IDL end-user license. To implement this, someone who does not hold an IDL license would have to reverse-engineer a set of
.SAVfiles sent to that person by someone else with an IDL license. so... that's a no. π« - Objects β IDL objects contain compiled code. that's it, that's the reason. π
π FUNCTIONS π
π§ ridl
$x = ridl("foo.sav");
Read an IDL save file from a file. bestie behavior.
Upon successful completion, $x is a hash ref containing all of the variables that are present in the save file, indexed by original variable name. π
IDL identifiers are case insensitive; they're all converted to upper-case in the hash that gets returned. This may be adjustable at a future date. Furthermore, because IDL identifiers can't contain special characters, some fields that start with '+' are used to store metadata about the file itself. (yes, we're being sneaky with the plus signs. it's fine.) π
Numeric arrays are stored as PDLs, structures are stored as hashes, and string and structure arrays are stored as perl lists. Named structure types don't exist in perl in the same way that they do in IDL, so named structures are described in the 'structs' field of the global metadata. Anonymous structures are treated as simple hashes. Named structures are also simple hashes, but they also contain a field '+name' that refers to the name of the structure type. π
π AUTHOR, LICENSE, NO WARRANTY π
THIS CODE IS PROVIDED WITH NO WARRANTY and may be distributed and/or modified under the same terms as PDL itself. read it again for the people in the back. π€
This code is based on the analysis of the IDL save file format published by Craig Markwardt in 2002. π«Ά
IDL is a trademark of Research Systems Incorporated (RSI). The PDL development team, and authors of this code, are not affiliated with RSI. fr fr. π
and that's the page, bestie!! this was perl v5.42.3 energy, dated 2026-08-19, and honestly? she ate. πβ¨ππ¦πΈ
π¦ where this page comes from
- ubuntu stonking: libpdl-io-idl-perl 2.099-2 Β· 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