home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / perl / 7491 < prev    next >
Encoding:
Text File  |  1992-12-17  |  2.2 KB  |  68 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!math.fu-berlin.de!news.th-darmstadt.de!iti.informatik.th-darmstadt.de!schrod
  3. From: schrod@iti.informatik.th-darmstadt.de (Joachim Schrod)
  4. Subject: Two bugs (and a patch for them) in perldb.pl
  5. Sender: news@news.th-darmstadt.de (The News System)
  6. Message-ID: <1992Dec17.183738.49175@news.th-darmstadt.de>
  7. Date: Thu, 17 Dec 1992 18:37:38 GMT
  8. Nntp-Posting-Host: hp5.iti.informatik.th-darmstadt.de
  9. Organization: TU Darmstadt
  10. Lines: 56
  11.  
  12. There are two small (but annoying) bugs in the Perl debugger,
  13. perldb.pl: The command
  14.  
  15.  -- V does not take the current package name as the default
  16.     (as the doc says it should)
  17.  
  18.  -- V (and, of course, X) does not output to DB'OUT, but on the
  19.     selected output handle.
  20.     If one debugs a routine which happens to write on a file it's
  21.     rather interesting to think first `well, nothing happened' and
  22.     finding the variables dump later in the output file... :) :) 
  23.     Actually, that's because perldb.pl uses the package dumpvar.pl,
  24.     which itself prints to the default output.
  25.  
  26. The following small patch suffices.
  27.  
  28. *** /usr/local/lib/perl/perldb.pl    Thu Sep 24 15:59:23 1992
  29. --- perldb.pl    Thu Dec 17 19:28:09 1992
  30. ***************
  31. *** 199,206 ****
  32.               next CMD; };
  33.           $cmd =~ s/^X\b/V $package/;
  34.           $cmd =~ /^V$/ && do {
  35. !             $cmd = 'V $package'; };
  36.           $cmd =~ /^V\b\s*(\S+)\s*(.*)/ && do {
  37.               $packname = $1;
  38.               @vars = split(' ',$2);
  39.               do 'dumpvar.pl' unless defined &main'dumpvar;
  40. --- 199,207 ----
  41.               next CMD; };
  42.           $cmd =~ s/^X\b/V $package/;
  43.           $cmd =~ /^V$/ && do {
  44. !             $cmd = "V $package"; };
  45.           $cmd =~ /^V\b\s*(\S+)\s*(.*)/ && do {
  46. +             local ($savout) = select(OUT);
  47.               $packname = $1;
  48.               @vars = split(' ',$2);
  49.               do 'dumpvar.pl' unless defined &main'dumpvar;
  50. ***************
  51. *** 210,215 ****
  52. --- 211,217 ----
  53.               else {
  54.               print DB'OUT "dumpvar.pl not available.\n";
  55.               }
  56. +             select ($savout);
  57.               next CMD; };
  58.           $cmd =~ /^f\b\s*(.*)/ && do {
  59.               $file = $1;
  60.  
  61. --
  62. Joachim
  63.  
  64. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  65. Joachim Schrod            Email: schrod@iti.informatik.th-darmstadt.de
  66. Computer Science Department
  67. Technical University of Darmstadt, Germany
  68.