PDL2(1)
π
PDL2 β the pdl2 page, but make it make sense π
okay so real talk, this is the manual for pdl2, the simple shell (version 2) for PDL, and it lives in the User Contributed Perl Documentation corner of your man pages. bestie, it's giving "just let me poke at PDL in a REPL" energy and honestly? iconic. π
β¨ SYNOPSIS β¨
use PDL interactively, that's the whole vibe:
%> pdl2
pdl> $x = sequence(10) # or any other perl or PDL command
pdl> print "\$x = $x\n";
$x = [0 1 2 3 4 5 6 7 8 9]
pdl> with_time { print +($A->matmult($B))->info, "\n" } for 1..5;
like, you just type perl and PDL stuff at the prompt and it does the thing. slay. π
πΈ DESCRIPTION πΈ
so the pdl2 program β also known as the Perldl2 shell β is a second generation version of the original perldl interactive PDL shell. it's trying to be backward compatible in usage while also serving improved features, better support for Perl syntax, and a more easily extended framework built on the Devel::REPL shell. glow-up fr fr. β¨
if you have Devel::REPL version 1.003011 or later, then pdl2 will start with full functionality. if Devel::REPL is not installed or not found, then pdl2 will print a warning and run the legacy perldl shell command instead. no cap, that's the fallback. π«Ά
by default, command lines beginning with the default prompt of either pdl2 or perldl (one of 'pdl> ', 'PDL> ', or 'perldl> ') will have the prefix string and surrounding whitespace stripped. this is lowkey the best part: it means you can easily cut-and-paste from sample PDL shell sessions or other examples straight into another PDL shell session. chef's kiss. ππ
for shell-like Ctrl+C handling, you need Sys::SigAction installed. that's the requirement, don't come for me. π
π₯ FUNCTIONS π₯
π do_print π
toggle print-by-default on and off (default value: off).
by default, pdl2 does not print the results of operations, because the results can be very large β e.g., a small 640x480 RGBA image is still more than 1_000_000 elements. π however, for experimenting and debugging more complex structures, it helps to see the results of every operation. the do_print routine lets you toggle between the default "quiet" operation and a full Read, Evaluate, Loop style. main character behaviour honestly. π
pdl> $x = pdl(3,2)
pdl> do_print
1
pdl> $x = pdl(3,2)
$PDL1 = [3 2];
pdl> do_print
pdl> $x = pdl(3,2)
see how do_print returns 1 when you flip it on, then the assignment echoes $PDL1 = [3 2];, and flipping it back (with no output) makes the next assignment quiet again? yeah. that's the whole bit. β¨
π¦ VARIABLES π¦
$PDL::toolongtoprintβ the maximal size pdls to print (defaults to10000elements). and listen, this is not just aperldlorpdl2variable β it's something that is usually needed in an interactive debugging session. so don't sleep on it. π
π SEE ALSO π
perldlDevel::REPL
ngl, go readperldlif you want the legacy lore, andDevel::REPLif you want to see the framework this whole thing rides on. iykyk. π§
that's the page, bestie π this one's from perl v5.32.1, dated 2022-04-11 β so yeah, a lil vintage, but still eating. ππ·
π¦ where this page comes from
- epel 9: perl-PDL 2.78.0-1.el9 Β· GPL+ or Artistic
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms