1Dbg(3) User Contributed Perl Documentation Dbg(3)
2
3
4
6 PDL::Dbg - functions to support debugging of PDL scripts
7
9 use PDL;
10 use PDL::Dbg;
11
12 $c = $x->slice("5:10,2:30")->px->diagonal(3,4);
13 PDL->px;
14
16 These packages implements a couple of functions that should come in
17 handy when debugging your PDL scripts. They make a lot of sense while
18 you're doing rapid prototyping of new PDL code, let's say inside the
19 perldl or pdl2 shell.
20
22 px
23 Print info about an ndarray (or all known ndarrays)
24
25 pdl> PDL->px
26 pdl> $y += $x->clump(2)->px('clumptest')->sumover
27 pdl> $x->px('%C (%A) Type: %T') # prints nothing unless $PDL::debug
28 pdl> $PDL::debug = 1
29 pdl> $x->px('%C (%A) Type: %T')
30 PDL (52433464) Type: Double
31
32 This function prints some information about ndarrays. It can be invoked
33 as a class method (e.g. "PDL->px" ) or as an instance method (e.g.
34 "$pdl->px($arg)"). If
35
36 invoked as a class method
37 it prints info about all ndarrays found in the current package
38 (excluding "my" variables). This comes in quite handy when you are
39 not quite sure which pdls you have already defined, what data they
40 hold , etc. "px" is supposed to support inheritance and prints info
41 about all symbols for which an isa($class) is true. An optional
42 string argument is interpreted as the package name for which to print
43 symbols:
44
45 pdl> PDL->px('PDL::Mypack')
46
47 The default package is that of the caller.
48
49 invoked as an instance method
50 it prints info about that particular ndarray if $PDL::debug is true
51 and returns the pdl object upon completion. It accepts an optional
52 string argument that is simply prepended to the default info if it
53 doesn't contain a "%" character. If, however, the argument contains a
54 "%" then the string is passed to the "info" method to control the
55 format of the printed information. This can be used to achieve
56 customized output from "px". See the documentation of "PDL::info" for
57 further details.
58
59 The output of px will be determined by the default formatting string
60 that is passed to the "info" method (unless you pass a string
61 containing "%" to px when invoking as an instance method, see above).
62 This default string is stored in $PDL::Dbg::Infostr and the default
63 output format can be accordingly changed by setting this variable. If
64 you do this you should also change the default title string that the
65 class method branch prints at the top of the listing to match your new
66 format string. The default title is stored in the variable
67 $PDL::Dbg::Title.
68
69 For historical reasons "vars" is an alias for "px".
70
71 vars
72 Alias for "px"
73
75 There are probably some. Please report if you find any. Bug reports
76 should be sent to the PDL mailing list
77 pdl-general@lists.sourceforge.net.
78
80 Copyright(C) 1997 Christian Soeller (c.soeller@auckland.ac.nz). All
81 rights reserved. There is no warranty. You are allowed to redistribute
82 this software / documentation under certain conditions. For details,
83 see the file COPYING in the PDL distribution. If this file is separated
84 from the PDL distribution, the copyright notice should be included in
85 the file.
86
87
88
89perl v5.36.0 2023-01-20 Dbg(3)