PDL2(1p)
π
PDL2 β bestie's guide to the pdl2 shell
okay so real talk: this is the manpage for pdl2 (that's PDL2(1p) in the User Contributed Perl Documentation corner of the world π«Ά). It's the second-gen interactive shell for PDL, and honestly? she's that girl. Let's get into it.
β¨ NAME β¨
pdl2 β a Simple shell (version 2) for PDL π
β¨ SYNOPSIS β¨
Use PDL interactively, bestie:
%> 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;
β¨ DESCRIPTION β¨
So the pdl2 program β also known as the Perldl2 shell β is a glow-up second generation version of the original perldl interactive PDL shell. She's trying to stay backward compatible in usage while serving improved features, better support for Perl syntax, and a way more easily extended framework based on the Devel::REPL shell. no cap, it's giving main character energy π
If you have Devel::REPL version 1.003011 or later, then pdl2 will start with full functionality β¨. If Devel::REPL is not installed or found, then pdl2 will print a warning and run the legacy perldl shell command instead. (she's flexible like that π)
By default, command lines beginning with the default prompt of either pdl2 or perldl β that's one of 'pdl> ', 'PDL> ', or 'perldl> ' β will have the prefix string and surrounding whitespace stripped. This allows for easy cut-and-paste from sample PDL shell sessions or other examples into another PDL shell session. π literally the bestie feature, copy-paste slay.
For shell-like Ctrl-C handling, you need Sys::SigAction installed.
β¨ FUNCTIONS β¨
πΈ do_print
Toggle print-by-default on and off (default value: off)
By default, pdl2 does not print the results of operations, since 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 allows you to toggle between the default "quiet" operation and a full Read, Evaluate, Loop style. π¦
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)
β¨ VARIABLES β¨
$PDL::toolongtoprintβ the maximal size pdls to print (defaults to10000elements). And ngl this is not just a"perldl"or"pdl2"variable β it's something that is usually needed in an interactive debugging session. so like, remember her π
β¨ SEE ALSO β¨
perldlDevel::REPL
and that's the whole vibe, bestie π β¨ this page came to you from perl v5.38.2, dated 2024-04-10 β periodt ππ«Άπ
π¦ where this page comes from
- ubuntu noble: pdl 1:2.085-1ubuntu1 Β· 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