Win32 sitelib intuition from DLL location
[p5sagit/p5-mst-13.2.git] / pod / perldebug.pod
index 25abfd6..7d8d84f 100644 (file)
@@ -8,6 +8,14 @@ First of all, have you tried using the B<-w> switch?
 
 =head1 The Perl Debugger
 
+"As soon as we started programming, we found to our
+surprise that it wasn't as easy to get programs right
+as we had thought.  Debugging had to be discovered.
+I can remember the exact instant when I realized that
+a large part of my life from then on was going to be
+spent in finding mistakes in my own programs."
+--Maurice Wilkes, 1949
+
 If you invoke Perl with the B<-d> switch, your script runs under the
 Perl source debugger.  This works like an interactive Perl
 environment, prompting for debugger commands that let you examine
@@ -332,6 +340,10 @@ If 0, allows I<stepping off> the end of the script.
 
 affects printing of return value after C<r> command.
 
+=item C<ornaments>
+
+affects screen appearance of the command line (see L<Term::ReadLine>).
+
 =item C<frame>
 
 affects printing messages on entry and exit from subroutines.  If
@@ -340,8 +352,11 @@ on exit may be useful if inter(di)spersed with other messages.)
 
 If C<frame & 4>, arguments to functions are printed as well as the
 context and caller info.  If C<frame & 8>, overloaded C<stringify> and
-C<tie>d C<FETCH> are enabled on the printed arguments.  The length at
-which the argument list is truncated is governed by the next option:
+C<tie>d C<FETCH> are enabled on the printed arguments. If C<frame &
+16>, the return value from the subroutine is printed as well.
+
+The length at which the argument list is truncated is governed by the
+next option:
 
 =item C<maxTraceLen>
 
@@ -468,37 +483,37 @@ See L<"Debugger Internals"> below for more details.
 =item E<lt> [ command ]
 
 Set an action (Perl command) to happen before every debugger prompt.
-A multiline command may be entered by backslashing the newlines.  If
+A multi-line command may be entered by backslashing the newlines.  If
 C<command> is missing, resets the list of actions.
 
 =item E<lt>E<lt> command
 
 Add an action (Perl command) to happen before every debugger prompt.
-A multiline command may be entered by backslashing the newlines.
+A multi-line command may be entered by backslashing the newlines.
 
 =item E<gt> command
 
 Set an action (Perl command) to happen after the prompt when you've
-just given a command to return to executing the script.  A multiline
+just given a command to return to executing the script.  A multi-line
 command may be entered by backslashing the newlines.  If C<command> is
 missing, resets the list of actions.
 
 =item E<gt>E<gt> command
 
 Adds an action (Perl command) to happen after the prompt when you've
-just given a command to return to executing the script.  A multiline
+just given a command to return to executing the script.  A multi-line
 command may be entered by backslashing the newlines.
 
 =item { [ command ]
 
 Set an action (debugger command) to happen before every debugger prompt.
-A multiline command may be entered by backslashing the newlines.  If
+A multi-line command may be entered by backslashing the newlines.  If
 C<command> is missing, resets the list of actions.
 
 =item {{ command
 
 Add an action (debugger command) to happen before every debugger prompt.
-A multiline command may be entered by backslashing the newlines.
+A multi-line command may be entered by backslashing the newlines.
 
 =item ! number
 
@@ -602,7 +617,7 @@ expression via C<s/n/t expression> command.
 
 =item Multiline commands
 
-If you want to enter a multiline command, such as a subroutine
+If you want to enter a multi-line command, such as a subroutine
 definition with several statements, or a format, you may escape the
 newline that would normally end the debugger command with a backslash.
 Here's an example:
@@ -669,7 +684,9 @@ optionally exited) subroutines in different styles.
 
 What follows is the start of the listing of
 
-  env "PERLDB_OPTS=f=1 N" perl -d -V
+  env "PERLDB_OPTS=f=n N" perl -d -V
+
+for different values of C<n>:
 
 =over 4
 
@@ -774,13 +791,33 @@ What follows is the start of the listing of
    in  $=Config::FETCH('Config=HASH(0x1aa444)', 'baserev') from lib/Config.pm:574
    out $=Config::FETCH('Config=HASH(0x1aa444)', 'baserev') from lib/Config.pm:574
 
+=item 30
+
+  in  $=CODE(0x15eca4)() from /dev/null:0
+   in  $=CODE(0x182528)() from lib/Config.pm:2
+    Package lib/Exporter.pm.
+   out $=CODE(0x182528)() from lib/Config.pm:0
+   scalar context return from CODE(0x182528): undef
+   Package lib/Config.pm.
+   in  $=Config::TIEHASH('Config') from lib/Config.pm:628
+   out $=Config::TIEHASH('Config') from lib/Config.pm:628
+   scalar context return from Config::TIEHASH:   empty hash
+   in  $=Exporter::import('Config', 'myconfig', 'config_vars') from /dev/null:0
+    in  $=Exporter::export('Config', 'main', 'myconfig', 'config_vars') from lib/Exporter.pm:171
+    out $=Exporter::export('Config', 'main', 'myconfig', 'config_vars') from lib/Exporter.pm:171
+    scalar context return from Exporter::export: ''
+   out $=Exporter::import('Config', 'myconfig', 'config_vars') from /dev/null:0
+   scalar context return from Exporter::import: ''
+
+
 =back
 
 In all the cases indentation of lines shows the call tree, if bit 2 of
 C<frame> is set, then a line is printed on exit from a subroutine as
 well, if bit 4 is set, then the arguments are printed as well as the
 caller info, if bit 8 is set, the arguments are printed even if they
-are tied or references.
+are tied or references, if bit 16 is set, the return value is printed
+as well.
 
 When a package is compiled, a line like this