From 231534d747581d9bd50dab8aa56ca78f8433785f Mon Sep 17 00:00:00 2001 From: rwp0 Date: Fri, 29 Dec 2023 15:16:30 +0100 Subject: [PATCH] [POD] `diagnostics.pm`: Remove indirect syntax Convert the below indirect syntax in documentation: ``` enable diagnostics; disable diagnostics; ``` Since `enable` and `disable` are only methods It's confusing to see barewords in the documentation. As a user I thought `diagnostics` should actually be a string argument to exported-by-default separate `enable` and `disable` subroutines. --- lib/diagnostics.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/diagnostics.pm b/lib/diagnostics.pm index 7074be6..842959a 100644 --- a/lib/diagnostics.pm +++ b/lib/diagnostics.pm @@ -11,8 +11,8 @@ Using the C pragma: use diagnostics; use diagnostics -verbose; - enable diagnostics; - disable diagnostics; + diagnostics->enable; + diagnostics->disable; Using the C standalone filter program: @@ -47,7 +47,7 @@ Due to the interaction between runtime and compiletime issues, and because it's probably not a very good idea anyway, you may not use C to turn them off at compiletime. However, you may control their behaviour at runtime using the -disable() and enable() methods to turn them off and on respectively. +C and C methods to turn them off and on respectively. The B<-verbose> flag first prints out the L introduction before any other diagnostics. The $diagnostics::PRETTY variable can generate nicer @@ -126,17 +126,17 @@ at the enable() or disable() methods. print BOGUS1 'nada'; print "done with 1st bogus\n"; - disable diagnostics; # only turns off runtime warnings + diagnostics->disable; # only turns off runtime warnings print "\ntime for 2nd bogus: (squelched)\n"; print BOGUS2 'nada'; print "done with 2nd bogus\n"; - enable diagnostics; # turns back on runtime warnings + diagnostics->enable; # turns back on runtime warnings print "\ntime for 3rd bogus: SQUAWKINGS\n"; print BOGUS3 'nada'; print "done with 3rd bogus\n"; - disable diagnostics; + diagnostics->disable; print "\ntime for 4th bogus: (squelched)\n"; print BOGUS4 'nada'; print "done with 4th bogus\n"; @@ -186,7 +186,7 @@ use 5.009001; use Carp; $Carp::Internal{__PACKAGE__.""}++; -our $VERSION = '1.39'; +our $VERSION = '1.40'; our $DEBUG; our $VERBOSE; our $PRETTY; -- 1.8.3.1