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 to 10000 elements). 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 ✨

  • perldl
  • Devel::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