6.4 Customizing the DebuggerYou can do some customizing by setting up a .perldb file with initialization code. When it starts up, the debugger reads and processes this file. For instance, you can set up aliases like these: You can also use this file to set options and to define a subroutine,$DB::alias{'len'} = 's/^len(.*)/p length($1)/'; $DB::alias{'stop'} = 's/^stop (at|in)/b/'; $DB::alias{'ps'} = 's/^ps\b/p scalar /'; $DB::alias{'quit'} = 's/^quit\b.*/exit/';
&afterinit
, to be executed after the debugger is
initialized.
After the configuration file has been processed, the debugger
consults the environment variable
PERLDB_OPTS and parses its contents as arguments to the
While any options can be set in PERLDB_OPTS, the
following options can
only
be specified at startup. If you want
to set them in your configuration file, call
For example, if you create the following .perldb file: your script will run without human intervention, putting trace information into the file db.out .&parse_options("NonStop=1 LineInfo=db.out"); sub afterinit { $trace = 1; } |
|