1IPC::Run::Debug(3)    User Contributed Perl Documentation   IPC::Run::Debug(3)
2
3
4

NAME

6       IPC::Run::Debug - debugging routines for IPC::Run
7

SYNOPSIS

9          ##
10          ## Environment variable usage
11          ##
12          ## To force debugging off and shave a bit of CPU and memory
13          ## by compile-time optimizing away all debugging code in IPC::Run
14          ## (debug => ...) options to IPC::Run will be ignored.
15          export IPCRUNDEBUG=none
16
17          ## To force debugging on (levels are from 0..10)
18          export IPCRUNDEBUG=basic
19
20          ## Leave unset or set to "" to compile in debugging support and
21          ## allow runtime control of it using the debug option.
22

DESCRIPTION

24       Controls IPC::Run debugging.  Debugging levels are now set by using
25       words, but the numbers shown are still supported for backwards
26       compatibility:
27
28          0  none         disabled (special, see below)
29          1  basic        what's running
30          2  data         what's being sent/received
31          3  details      what's going on in more detail
32          4  gory         way too much detail for most uses
33          10 all          use this when submitting bug reports
34             noopts       optimizations forbidden due to inherited STDIN
35
36       The "none" level is special when the environment variable IPCRUNDEBUG
37       is set to this the first time IPC::Run::Debug is loaded: it prevents
38       the debugging code from being compiled in to the remaining IPC::Run
39       modules, saving a bit of cpu.
40
41       To do this in a script, here's a way that allows it to be overridden:
42
43          BEGIN {
44             unless ( defined $ENV{IPCRUNDEBUG} ) {
45                eval 'local $ENV{IPCRUNDEBUG} = "none"; require IPC::Run::Debug"'
46                   or die $@;
47             }
48          }
49
50       This should force IPC::Run to not be debuggable unless somebody sets
51       the IPCRUNDEBUG flag; modify this formula to grep @ARGV if need be:
52
53          BEGIN {
54             unless ( grep /^--debug/, @ARGV ) {
55                eval 'local $ENV{IPCRUNDEBUG} = "none"; require IPC::Run::Debug"'
56                or die $@;
57          }
58
59       Both of those are untested.
60

AUTHOR

62       Barrie Slaymaker <barries@slaysys.com>, with numerous suggestions by
63       p5p.
64
65
66
67perl v5.36.0                      2023-01-20                IPC::Run::Debug(3)
Impressum