This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 5.0 alpha 5
[perl5.git] / lib / perldb.pl
CommitLineData
a687059c
LW
1package DB;
2
f0fcb552
LW
3# modified Perl debugger, to be run from Emacs in perldb-mode
4# Ray Lischner (uunet!mntgfx!lisch) as of 5 Nov 1990
5# Johan Vromans -- upgrade to 4.0 pl 10
6
79072805 7$header = '$RCSfile: perldb.pl,v $$Revision: 4.1 $$Date: 92/08/07 18:24:07 $';
a687059c
LW
8#
9# This file is automatically included if you do perl -d.
10# It's probably not useful to include this yourself.
11#
12# Perl supplies the values for @line and %sub. It effectively inserts
13# a do DB'DB(<linenum>); in front of every place that can
14# have a breakpoint. It also inserts a do 'perldb.pl' before the first line.
15#
16# $Log: perldb.pl,v $
79072805
LW
17# Revision 4.1 92/08/07 18:24:07 lwall
18#
83025b21
LW
19# Revision 4.0.1.3 92/06/08 13:43:57 lwall
20# patch20: support for MSDOS folded into perldb.pl
21# patch20: perldb couldn't debug file containing '-', such as STDIN designator
22#
f0fcb552
LW
23# Revision 4.0.1.2 91/11/05 17:55:58 lwall
24# patch11: perldb.pl modified to run within emacs in perldb-mode
25#
9ef589d8
LW
26# Revision 4.0.1.1 91/06/07 11:17:44 lwall
27# patch4: added $^P variable to control calling of perldb routines
28# patch4: debugger sometimes listed wrong number of lines for a statement
29#
fe14fcc3
LW
30# Revision 4.0 91/03/20 01:25:50 lwall
31# 4.0 baseline.
32#
27e2fb84
LW
33# Revision 3.0.1.6 91/01/11 18:08:58 lwall
34# patch42: @_ couldn't be accessed from debugger
35#
34de22dd
LW
36# Revision 3.0.1.5 90/11/10 01:40:26 lwall
37# patch38: the debugger wouldn't stop correctly or do action routines
38#
76854fea
LW
39# Revision 3.0.1.4 90/10/15 17:40:38 lwall
40# patch29: added caller
41# patch29: the debugger now understands packages and evals
42# patch29: scripts now run at almost full speed under the debugger
43# patch29: more variables are settable from debugger
44#
33b78306
LW
45# Revision 3.0.1.3 90/08/09 04:00:58 lwall
46# patch19: debugger now allows continuation lines
47# patch19: debugger can now dump lists of variables
48# patch19: debugger can now add aliases easily from prompt
49#
79a0689e
LW
50# Revision 3.0.1.2 90/03/12 16:39:39 lwall
51# patch13: perl -d didn't format stack traces of *foo right
52# patch13: perl -d wiped out scalar return values of subroutines
53#
03a14243
LW
54# Revision 3.0.1.1 89/10/26 23:14:02 lwall
55# patch1: RCS expanded an unintended $Header in lib/perldb.pl
56#
a687059c
LW
57# Revision 3.0 89/10/18 15:19:46 lwall
58# 3.0 baseline
59#
60# Revision 2.0 88/06/05 00:09:45 root
61# Baseline version 2.0.
62#
63#
64
83025b21
LW
65if (-e "/dev/tty") {
66 $console = "/dev/tty";
67 $rcfile=".perldb";
68}
69else {
70 $console = "con";
71 $rcfile="perldb.ini";
72}
73
74open(IN, "<$console") || open(IN, "<&STDIN"); # so we don't dingle stdin
75open(OUT,">$console") || open(OUT, ">&STDOUT"); # so we don't dongle stdout
a687059c 76select(OUT);
ed6116ce 77$| = 1; # for DB::OUT
a687059c
LW
78select(STDOUT);
79$| = 1; # for real STDOUT
76854fea 80$sub = '';
a687059c 81
f0fcb552 82# Is Perl being run from Emacs?
ed6116ce
LW
83$emacs = $main::ARGV[$[] eq '-emacs';
84shift(@main::ARGV) if $emacs;
f0fcb552 85
03a14243 86$header =~ s/.Header: ([^,]+),v(\s+\S+\s+\S+).*$/$1$2/;
f0fcb552
LW
87print OUT "\nLoading DB routines from $header\n";
88print OUT ("Emacs support ",
89 $emacs ? "enabled" : "available",
90 ".\n");
91print OUT "\nEnter h for help.\n\n";
a687059c
LW
92
93sub DB {
76854fea
LW
94 &save;
95 ($package, $filename, $line) = caller;
96 $usercontext = '($@, $!, $[, $,, $/, $\) = @saved;' .
97 "package $package;"; # this won't let them modify, alas
9ef589d8 98 local($^P) = 0; # don't debug our own evals
ed6116ce 99 local(*dbline) = "::_<$filename";
76854fea
LW
100 $max = $#dbline;
101 if (($stop,$action) = split(/\0/,$dbline{$line})) {
a687059c
LW
102 if ($stop eq '1') {
103 $signal |= 1;
104 }
105 else {
ed6116ce 106 $evalarg = "\$DB::signal |= do {$stop;}"; &eval;
76854fea 107 $dbline{$line} =~ s/;9($|\0)/$1/;
a687059c
LW
108 }
109 }
110 if ($single || $trace || $signal) {
f0fcb552
LW
111 if ($emacs) {
112 print OUT "\032\032$filename:$line:0\n";
113 } else {
ed6116ce 114 print OUT "$package::" unless $sub =~ /'|::/;
f0fcb552
LW
115 print OUT "$sub($filename:$line):\t",$dbline[$line];
116 for ($i = $line + 1; $i <= $max && $dbline[$i] == 0; ++$i) {
117 last if $dbline[$i] =~ /^\s*(}|#|\n)/;
118 print OUT "$sub($filename:$i):\t",$dbline[$i];
119 }
a687059c
LW
120 }
121 }
27e2fb84 122 $evalarg = $action, &eval if $action;
a687059c 123 if ($single || $signal) {
27e2fb84 124 $evalarg = $pre, &eval if $pre;
a687059c
LW
125 print OUT $#stack . " levels deep in subroutine calls!\n"
126 if $single & 4;
127 $start = $line;
fe14fcc3 128 CMD:
76854fea 129 while ((print OUT " DB<", $#hist+1, "> "), $cmd=&gets) {
fe14fcc3
LW
130 {
131 $single = 0;
132 $signal = 0;
133 $cmd eq '' && exit 0;
134 chop($cmd);
135 $cmd =~ s/\\$// && do {
136 print OUT " cont: ";
137 $cmd .= &gets;
138 redo CMD;
139 };
140 $cmd =~ /^q$/ && exit 0;
141 $cmd =~ /^$/ && ($cmd = $laststep);
142 push(@hist,$cmd) if length($cmd) > 1;
143 ($i) = split(/\s+/,$cmd);
144 eval "\$cmd =~ $alias{$i}", print OUT $@ if $alias{$i};
145 $cmd =~ /^h$/ && do {
146 print OUT "
a687059c
LW
147T Stack trace.
148s Single step.
149n Next, steps over subroutine calls.
76854fea 150r Return from current subroutine.
a687059c
LW
151c [line] Continue; optionally inserts a one-time-only breakpoint
152 at the specified line.
153<CR> Repeat last n or s.
154l min+incr List incr+1 lines starting at min.
155l min-max List lines.
156l line List line;
157l List next window.
158- List previous window.
159w line List window around line.
160l subname List subroutine.
76854fea 161f filename Switch to filename.
a687059c
LW
162/pattern/ Search forwards for pattern; final / is optional.
163?pattern? Search backwards for pattern.
164L List breakpoints and actions.
165S List subroutine names.
166t Toggle trace mode.
167b [line] [condition]
168 Set breakpoint; line defaults to the current execution line;
169 condition breaks if it evaluates to true, defaults to \'1\'.
170b subname [condition]
171 Set breakpoint at first line of subroutine.
172d [line] Delete breakpoint.
173D Delete all breakpoints.
174a [line] command
175 Set an action to be done before the line is executed.
176 Sequence is: check for breakpoint, print line if necessary,
177 do action, prompt user if breakpoint or step, evaluate line.
178A Delete all actions.
76854fea
LW
179V [pkg [vars]] List some (default all) variables in package (default current).
180X [vars] Same as \"V currentpackage [vars]\".
a687059c
LW
181< command Define command before prompt.
182> command Define command after prompt.
183! number Redo command (default previous command).
184! -number Redo number\'th to last command.
185H -number Display last number commands (default all).
186q or ^D Quit.
ed6116ce 187p expr Same as \"print DB::OUT expr\" in current package.
33b78306 188= [alias value] Define a command alias, or list current aliases.
76854fea 189command Execute as a perl statement in current package.
a687059c
LW
190
191";
fe14fcc3
LW
192 next CMD; };
193 $cmd =~ /^t$/ && do {
194 $trace = !$trace;
195 print OUT "Trace = ".($trace?"on":"off")."\n";
196 next CMD; };
197 $cmd =~ /^S$/ && do {
198 foreach $subname (sort(keys %sub)) {
199 print OUT $subname,"\n";
200 }
201 next CMD; };
202 $cmd =~ s/^X\b/V $package/;
203 $cmd =~ /^V$/ && do {
79072805 204 $cmd = "V $package"; };
fe14fcc3 205 $cmd =~ /^V\b\s*(\S+)\s*(.*)/ && do {
79072805 206 local ($savout) = select(OUT);
fe14fcc3
LW
207 $packname = $1;
208 @vars = split(' ',$2);
ed6116ce
LW
209 do 'dumpvar.pl' unless defined &main::dumpvar;
210 if (defined &main::dumpvar) {
211 &main::dumpvar($packname,@vars);
fe14fcc3
LW
212 }
213 else {
ed6116ce 214 print DB::OUT "dumpvar.pl not available.\n";
76854fea 215 }
79072805 216 select ($savout);
fe14fcc3
LW
217 next CMD; };
218 $cmd =~ /^f\b\s*(.*)/ && do {
219 $file = $1;
220 if (!$file) {
221 print OUT "The old f command is now the r command.\n";
222 print OUT "The new f command switches filenames.\n";
223 next CMD;
a687059c 224 }
ed6116ce
LW
225 if (!defined $::_main{'_<' . $file}) {
226 if (($try) = grep(m#^_<.*$file#, keys %::_main)) {
fe14fcc3
LW
227 $file = substr($try,2);
228 print "\n$file:\n";
76854fea
LW
229 }
230 }
ed6116ce 231 if (!defined $::_main{'_<' . $file}) {
fe14fcc3
LW
232 print OUT "There's no code here anything matching $file.\n";
233 next CMD;
234 }
235 elsif ($file ne $filename) {
ed6116ce 236 *dbline = "::_<$file";
fe14fcc3
LW
237 $max = $#dbline;
238 $filename = $file;
239 $start = 1;
240 $cmd = "l";
241 } };
ed6116ce 242 $cmd =~ /^l\b\s*([':A-Za-z_][':\w]*)/ && do {
fe14fcc3 243 $subname = $1;
ed6116ce
LW
244 $subname = "main::" . $subname unless $subname =~ /'|::/;
245 $subname = "main" . $subname if substr($subname,0,1)eq "'";
246 $subname = "main" . $subname if substr($subname,0,2)eq "::";
fe14fcc3
LW
247 ($file,$subrange) = split(/:/,$sub{$subname});
248 if ($file ne $filename) {
ed6116ce 249 *dbline = "::_<$file";
fe14fcc3
LW
250 $max = $#dbline;
251 $filename = $file;
252 }
253 if ($subrange) {
254 if (eval($subrange) < -$window) {
255 $subrange =~ s/-.*/+/;
256 }
257 $cmd = "l $subrange";
258 } else {
259 print OUT "Subroutine $1 not found.\n";
260 next CMD;
261 } };
262 $cmd =~ /^w\b\s*(\d*)$/ && do {
263 $incr = $window - 1;
264 $start = $1 if $1;
265 $start -= $preview;
266 $cmd = 'l ' . $start . '-' . ($start + $incr); };
267 $cmd =~ /^-$/ && do {
268 $incr = $window - 1;
269 $cmd = 'l ' . ($start-$window*2) . '+'; };
270 $cmd =~ /^l$/ && do {
271 $incr = $window - 1;
272 $cmd = 'l ' . $start . '-' . ($start + $incr); };
273 $cmd =~ /^l\b\s*(\d*)\+(\d*)$/ && do {
274 $start = $1 if $1;
275 $incr = $2;
276 $incr = $window - 1 unless $incr;
277 $cmd = 'l ' . $start . '-' . ($start + $incr); };
278 $cmd =~ /^l\b\s*(([\d\$\.]+)([-,]([\d\$\.]+))?)?/ && do {
279 $end = (!$2) ? $max : ($4 ? $4 : $2);
280 $end = $max if $end > $max;
281 $i = $2;
282 $i = $line if $i eq '.';
283 $i = 1 if $i < 1;
f0fcb552
LW
284 if ($emacs) {
285 print OUT "\032\032$filename:$i:0\n";
286 $i = $end;
287 } else {
288 for (; $i <= $end; $i++) {
289 print OUT "$i:\t", $dbline[$i];
290 last if $signal;
291 }
a687059c 292 }
fe14fcc3
LW
293 $start = $i; # remember in case they want more
294 $start = $max if $start > $max;
295 next CMD; };
296 $cmd =~ /^D$/ && do {
297 print OUT "Deleting all breakpoints...\n";
298 for ($i = 1; $i <= $max ; $i++) {
299 if (defined $dbline{$i}) {
300 $dbline{$i} =~ s/^[^\0]+//;
301 if ($dbline{$i} =~ s/^\0?$//) {
302 delete $dbline{$i};
303 }
304 }
305 }
306 next CMD; };
307 $cmd =~ /^L$/ && do {
308 for ($i = 1; $i <= $max; $i++) {
309 if (defined $dbline{$i}) {
310 print OUT "$i:\t", $dbline[$i];
311 ($stop,$action) = split(/\0/, $dbline{$i});
312 print OUT " break if (", $stop, ")\n"
313 if $stop;
314 print OUT " action: ", $action, "\n"
315 if $action;
316 last if $signal;
317 }
318 }
319 next CMD; };
ed6116ce 320 $cmd =~ /^b\b\s*([':A-Za-z_][':\w]*)\s*(.*)/ && do {
fe14fcc3
LW
321 $subname = $1;
322 $cond = $2 || '1';
ed6116ce 323 $subname = "$package::" . $subname unless $subname =~ /'|::/;
fe14fcc3 324 $subname = "main" . $subname if substr($subname,0,1) eq "'";
ed6116ce 325 $subname = "main" . $subname if substr($subname,0,2) eq "::";
83025b21
LW
326 ($filename,$i) = split(/:/, $sub{$subname});
327 $i += 0;
fe14fcc3 328 if ($i) {
ed6116ce 329 *dbline = "::_<$filename";
fe14fcc3
LW
330 ++$i while $dbline[$i] == 0 && $i < $#dbline;
331 $dbline{$i} =~ s/^[^\0]*/$cond/;
332 } else {
333 print OUT "Subroutine $subname not found.\n";
76854fea 334 }
fe14fcc3
LW
335 next CMD; };
336 $cmd =~ /^b\b\s*(\d*)\s*(.*)/ && do {
337 $i = ($1?$1:$line);
338 $cond = $2 || '1';
76854fea 339 if ($dbline[$i] == 0) {
fe14fcc3
LW
340 print OUT "Line $i not breakable.\n";
341 } else {
342 $dbline{$i} =~ s/^[^\0]*/$cond/;
a687059c 343 }
fe14fcc3
LW
344 next CMD; };
345 $cmd =~ /^d\b\s*(\d+)?/ && do {
346 $i = ($1?$1:$line);
347 $dbline{$i} =~ s/^[^\0]*//;
348 delete $dbline{$i} if $dbline{$i} eq '';
349 next CMD; };
350 $cmd =~ /^A$/ && do {
351 for ($i = 1; $i <= $max ; $i++) {
352 if (defined $dbline{$i}) {
353 $dbline{$i} =~ s/\0[^\0]*//;
354 delete $dbline{$i} if $dbline{$i} eq '';
76854fea 355 }
fe14fcc3
LW
356 }
357 next CMD; };
358 $cmd =~ /^<\s*(.*)/ && do {
359 $pre = do action($1);
360 next CMD; };
361 $cmd =~ /^>\s*(.*)/ && do {
362 $post = do action($1);
363 next CMD; };
364 $cmd =~ /^a\b\s*(\d+)(\s+(.*))?/ && do {
365 $i = $1;
366 if ($dbline[$i] == 0) {
367 print OUT "Line $i may not have an action.\n";
368 } else {
369 $dbline{$i} =~ s/\0[^\0]*//;
370 $dbline{$i} .= "\0" . do action($3);
371 }
372 next CMD; };
373 $cmd =~ /^n$/ && do {
374 $single = 2;
375 $laststep = $cmd;
376 last CMD; };
377 $cmd =~ /^s$/ && do {
378 $single = 1;
379 $laststep = $cmd;
380 last CMD; };
381 $cmd =~ /^c\b\s*(\d*)\s*$/ && do {
382 $i = $1;
383 if ($i) {
384 if ($dbline[$i] == 0) {
385 print OUT "Line $i not breakable.\n";
386 next CMD;
76854fea 387 }
fe14fcc3 388 $dbline{$i} =~ s/(\0|$)/;9$1/; # add one-time-only b.p.
76854fea 389 }
fe14fcc3
LW
390 for ($i=0; $i <= $#stack; ) {
391 $stack[$i++] &= ~1;
a687059c 392 }
fe14fcc3
LW
393 last CMD; };
394 $cmd =~ /^r$/ && do {
395 $stack[$#stack] |= 2;
396 last CMD; };
397 $cmd =~ /^T$/ && do {
398 local($p,$f,$l,$s,$h,$a,@a,@sub);
399 for ($i = 1; ($p,$f,$l,$s,$h,$w) = caller($i); $i++) {
400 @a = @args;
401 for (@a) {
ed6116ce
LW
402 s/'/\\'/g;
403 s/([^\0]*)/'$1'/ unless /^-?[\d.]+$/;
404 s/([\200-\377])/sprintf("M-%c",ord($1)&0177)/eg;
405 s/([\0-\37\177])/sprintf("^%c",ord($1)^64)/eg;
fe14fcc3
LW
406 }
407 $w = $w ? '@ = ' : '$ = ';
408 $a = $h ? '(' . join(', ', @a) . ')' : '';
409 push(@sub, "$w&$s$a from file $f line $l\n");
410 last if $signal;
a687059c 411 }
fe14fcc3
LW
412 for ($i=0; $i <= $#sub; $i++) {
413 last if $signal;
414 print OUT $sub[$i];
a687059c 415 }
fe14fcc3
LW
416 next CMD; };
417 $cmd =~ /^\/(.*)$/ && do {
418 $inpat = $1;
419 $inpat =~ s:([^\\])/$:$1:;
420 if ($inpat ne "") {
421 eval '$inpat =~ m'."\n$inpat\n";
422 if ($@ ne "") {
423 print OUT "$@";
424 next CMD;
425 }
426 $pat = $inpat;
a687059c 427 }
fe14fcc3
LW
428 $end = $start;
429 eval '
430 for (;;) {
431 ++$start;
432 $start = 1 if ($start > $max);
433 last if ($start == $end);
434 if ($dbline[$start] =~ m'."\n$pat\n".'i) {
f0fcb552
LW
435 if ($emacs) {
436 print OUT "\032\032$filename:$start:0\n";
437 } else {
438 print OUT "$start:\t", $dbline[$start], "\n";
439 }
fe14fcc3
LW
440 last;
441 }
442 } ';
443 print OUT "/$pat/: not found\n" if ($start == $end);
444 next CMD; };
445 $cmd =~ /^\?(.*)$/ && do {
446 $inpat = $1;
447 $inpat =~ s:([^\\])\?$:$1:;
448 if ($inpat ne "") {
449 eval '$inpat =~ m'."\n$inpat\n";
450 if ($@ ne "") {
451 print OUT "$@";
452 next CMD;
453 }
454 $pat = $inpat;
455 }
456 $end = $start;
457 eval '
458 for (;;) {
459 --$start;
460 $start = $max if ($start <= 0);
461 last if ($start == $end);
462 if ($dbline[$start] =~ m'."\n$pat\n".'i) {
f0fcb552
LW
463 if ($emacs) {
464 print OUT "\032\032$filename:$start:0\n";
465 } else {
466 print OUT "$start:\t", $dbline[$start], "\n";
467 }
fe14fcc3
LW
468 last;
469 }
470 } ';
471 print OUT "?$pat?: not found\n" if ($start == $end);
472 next CMD; };
473 $cmd =~ /^!+\s*(-)?(\d+)?$/ && do {
474 pop(@hist) if length($cmd) > 1;
475 $i = ($1?($#hist-($2?$2:1)):($2?$2:$#hist));
476 $cmd = $hist[$i] . "\n";
477 print OUT $cmd;
478 redo CMD; };
479 $cmd =~ /^!(.+)$/ && do {
480 $pat = "^$1";
481 pop(@hist) if length($cmd) > 1;
482 for ($i = $#hist; $i; --$i) {
483 last if $hist[$i] =~ $pat;
484 }
485 if (!$i) {
486 print OUT "No such command!\n\n";
487 next CMD;
488 }
489 $cmd = $hist[$i] . "\n";
490 print OUT $cmd;
491 redo CMD; };
492 $cmd =~ /^H\b\s*(-(\d+))?/ && do {
493 $end = $2?($#hist-$2):0;
494 $hist = 0 if $hist < 0;
495 for ($i=$#hist; $i>$end; $i--) {
496 print OUT "$i: ",$hist[$i],"\n"
497 unless $hist[$i] =~ /^.?$/;
498 };
499 next CMD; };
ed6116ce 500 $cmd =~ s/^p( .*)?$/print DB::OUT$1/;
fe14fcc3
LW
501 $cmd =~ /^=/ && do {
502 if (local($k,$v) = ($cmd =~ /^=\s*(\S+)\s+(.*)/)) {
503 $alias{$k}="s~$k~$v~";
504 print OUT "$k = $v\n";
505 } elsif ($cmd =~ /^=\s*$/) {
506 foreach $k (sort keys(%alias)) {
507 if (($v = $alias{$k}) =~ s~^s\~$k\~(.*)\~$~$1~) {
508 print OUT "$k = $v\n";
509 } else {
510 print OUT "$k\t$alias{$k}\n";
511 };
33b78306
LW
512 };
513 };
fe14fcc3
LW
514 next CMD; };
515 }
27e2fb84 516 $evalarg = $cmd; &eval;
76854fea 517 print OUT "\n";
a687059c
LW
518 }
519 if ($post) {
27e2fb84 520 $evalarg = $post; &eval;
a687059c
LW
521 }
522 }
76854fea
LW
523 ($@, $!, $[, $,, $/, $\) = @saved;
524}
525
526sub save {
527 @saved = ($@, $!, $[, $,, $/, $\);
528 $[ = 0; $, = ""; $/ = "\n"; $\ = "";
529}
530
27e2fb84
LW
531# The following takes its argument via $evalarg to preserve current @_
532
76854fea 533sub eval {
ed6116ce 534 eval "$usercontext $evalarg; &DB::save";
76854fea 535 print OUT $@;
a687059c
LW
536}
537
538sub action {
539 local($action) = @_;
540 while ($action =~ s/\\$//) {
541 print OUT "+ ";
76854fea 542 $action .= &gets;
a687059c
LW
543 }
544 $action;
545}
546
76854fea
LW
547sub gets {
548 local($.);
549 <IN>;
550}
551
a687059c
LW
552sub catch {
553 $signal = 1;
554}
555
556sub sub {
557 push(@stack, $single);
558 $single &= 1;
559 $single |= 4 if $#stack == $deep;
a687059c
LW
560 if (wantarray) {
561 @i = &$sub;
79a0689e
LW
562 $single |= pop(@stack);
563 @i;
a687059c
LW
564 }
565 else {
566 $i = &$sub;
79a0689e
LW
567 $single |= pop(@stack);
568 $i;
a687059c 569 }
a687059c
LW
570}
571
572$single = 1; # so it stops on first executable statement
a687059c 573@hist = ('?');
ed6116ce 574$SIG{'INT'} = "DB::catch";
a687059c
LW
575$deep = 100; # warning if stack gets this deep
576$window = 10;
577$preview = 3;
578
579@stack = (0);
76854fea 580@ARGS = @ARGV;
a687059c
LW
581for (@args) {
582 s/'/\\'/g;
583 s/(.*)/'$1'/ unless /^-?[\d.]+$/;
584}
a687059c 585
83025b21
LW
586if (-f $rcfile) {
587 do "./$rcfile";
a687059c 588}
83025b21
LW
589elsif (-f "$ENV{'LOGDIR'}/$rcfile") {
590 do "$ENV{'LOGDIR'}/$rcfile";
a687059c 591}
83025b21
LW
592elsif (-f "$ENV{'HOME'}/$rcfile") {
593 do "$ENV{'HOME'}/$rcfile";
a687059c
LW
594}
595
5961;