1PDL2(1) User Contributed Perl Documentation PDL2(1)
2
3
4
6 pdl2 - Simple shell (version 2) for PDL
7
9 Use PDL interactively:
10
11 %> pdl2
12
13 pdl> $x = sequence(10) # or any other perl or PDL command
14
15 pdl> print "\$x = $x\n";
16 $x = [0 1 2 3 4 5 6 7 8 9]
17
18 pdl> with_time { print +($A->matmult($B))->info, "\n" } for 1..5;
19
21 The "pdl2" program, also known as the Perldl2 shell, is a second
22 generation version of the original "perldl" interactive PDL shell. It
23 attempts to be backward compatible in usage while providing improved
24 features, better support for Perl syntax, and an more easily extended
25 framework based on the Devel::REPL shell.
26
27 If you have Devel::REPL version 1.003011 or later, then "pdl2" will
28 start with full functionality. If Devel::REPL is not installed or
29 found then "pdl2" will print a warning and run the legacy "perldl"
30 shell command instead.
31
32 By default, command lines beginning with the default prompt of either
33 "pdl2" or "perldl" (one of 'pdl> ', 'PDL> ', or 'perldl> ') will have
34 the prefix string and surrounding whitespace stripped. This allows for
35 easy cut-and-paste from sample PDL shell sessions or other examples
36 into another PDL shell session.
37
38 For shell-like "Ctrl-C" handling, you need Sys::SigAction installed.
39
41 do_print
42 Toggle print-by-default on and off (default value: off)
43
44 By default, "pdl2" does not print the results of operations since the
45 results can be very large (e.g., a small 640x480 RGBA image is still
46 more than 1_000_000 elements). However, for experimenting and
47 debugging more complex structures, it helps to see the results of every
48 operation. The "do_print" routine allows you to toggle between the
49 default "quiet" operation and a full Read, Evaluate, Loop style.
50
51 pdl> $x = pdl(3,2)
52
53 pdl> do_print
54 1
55 pdl> $x = pdl(3,2)
56 $PDL1 = [3 2];
57 pdl> do_print
58
59 pdl> $x = pdl(3,2)
60
62 $PDL::toolongtoprint
63 The maximal size pdls to print (defaults to 10000 elements). This
64 is not just a "perldl" or "pdl2" variable but it is something that
65 is usually needed in an interactive debugging session.
66
68 perldl, Devel::REPL
69
70
71
72perl v5.38.0 2023-07-21 PDL2(1)