X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fdiagnostics.pm;h=f174ee5feb8148045b9c7f382ae252006a4ed850;hb=054b02d6604bb3beeebed2d8a040d025b131c9a6;hp=10016f3bb7d806ad19c01ea6dfe1f9eb86cc1632;hpb=5025c45a2e969afb692d1ff0cd507cc26230784b;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/diagnostics.pm b/lib/diagnostics.pm old mode 100644 new mode 100755 index 10016f3..f174ee5 --- a/lib/diagnostics.pm +++ b/lib/diagnostics.pm @@ -27,7 +27,7 @@ Aa a program: =head2 The C Pragma This module extends the terse diagnostics normally emitted by both the -perl compiler and the perl interpeter, augmenting them with the more +perl compiler and the perl interpreter, augmenting them with the more explicative and endearing descriptions found in L. Like the other pragmata, it affects the compilation phase of your program rather than merely the execution phase. @@ -51,6 +51,11 @@ The B<-verbose> flag first prints out the L introduction before any other diagnostics. The $diagnostics::PRETTY variable can generate nicer escape sequences for pagers. +Warnings dispatched from perl itself (or more accurately, those that match +descriptions found in L) are only displayed once (no duplicate +descriptions). User code generated warnings ala warn() are unaffected, +allowing duplicate user messages to be displayed. + =head2 The I Program While apparently a whole nuther program, I is actually nothing @@ -175,6 +180,8 @@ if ($^O eq 'VMS') { @trypod = ("$archlib/pod/perldiag.pod", "$privlib/pod/perldiag-$].pod", "$privlib/pod/perldiag.pod"); +# handy for development testing of new warnings etc +unshift @trypod, "./pod/perldiag.pod" if -e "pod/perldiag.pod"; ($PODFILE) = ((grep { -e } @trypod), $trypod[$#trypod])[0]; $DEBUG ||= 0; @@ -272,7 +279,7 @@ if (eof(POD_DIAG)) { $transmo = < (?:line|chunk).*$//; $real = s/(.*?) at .*? (?:line|chunk) \d+.*/$1/; s/^\((.*)\)$/$1/; - return 0 unless &transmo; + if ($exact_duplicate{$orig}++) { + return &transmo; + } + else { + return 0 unless &transmo; + } $orig = shorten($orig); if ($old_diag{$_}) { autodescribe(); @@ -524,7 +533,7 @@ sub shorten { } -# have to do this: RS isn't set until run time, but we're executing at compile time +# have to do this: RS isn't set until run time, but we're executing at compiletime $RS = "\n"; 1 unless $standalone; # or it'll complain about itself