diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-12-20 14:54:10 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-12-20 14:54:10 +0000 |
commit | fa75652c1970cc67d47b9b046e2e323ec6b13df9 (patch) | |
tree | 91078d5f65adf32f4f601c87ba42b2f1ec9716c9 /ext/B | |
parent | ca0b1549b226ca8b27244628277cb91fbee62f1c (diff) | |
download | perl-fa75652c1970cc67d47b9b046e2e323ec6b13df9.tar.gz |
POD nits on B::Lint
p4raw-id: //depot/perl@26421
Diffstat (limited to 'ext/B')
-rw-r--r-- | ext/B/B/Lint.pm | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/ext/B/B/Lint.pm b/ext/B/B/Lint.pm index 253044d786..58015b94bd 100644 --- a/ext/B/B/Lint.pm +++ b/ext/B/B/Lint.pm @@ -124,30 +124,29 @@ include other package names whose subs are then checked by Lint. Lint can be extended by registering plugins. -The C<B::Lint->register_plugin( MyPlugin => \ @new_checks ) method +The C<< B::Lint->register_plugin( MyPlugin => \@new_checks ) >> method adds the class C<MyPlugin> to the list of plugins. It also adds the list of C<@new_checks> to the list of valid checks. -You must create a C<match( \ %checks )> method in your plugin class or -one of its inheritence parents. It will be called on every op as a -regular method call with a hash ref of checks as its parameter. +You must create a C<match( \%checks )> method in your plugin class or one +of its parents. It will be called on every op as a regular method call +with a hash ref of checks as its parameter. -You may not alter the check hash reference. +You may not alter the %checks hash reference. -The class methods C<B::Lint->file> and C<B::Lint->line> contain the -current filename and line number. +The class methods C<< B::Lint->file >> and C<< B::Lint->line >> contain +the current filename and line number. - package Sample; - use B::Lint; - B::Lint->register_plugin( Sample => [ 'good_taste' ] ); - - sub match { - my ( $op, $checks_href ) = shift; - - if ( $checks_href->{good_taste} ) { - ... - } - } + package Sample; + use B::Lint; + B::Lint->register_plugin( Sample => [ 'good_taste' ] ); + + sub match { + my ( $op, $checks_href ) = shift; + if ( $checks_href->{good_taste} ) { + ... + } + } =head1 BUGS @@ -226,6 +225,7 @@ sub B::OP::lint { $m = $_->can('match'), $op->$m( \ %check ) for @plugins; return; } + *$_ = *B::OP::lint for \ ( *B::PADOP::lint, *B::LOGOP::lint, @@ -456,13 +456,13 @@ sub compile { } } # Remaining arguments are things to check - + return \&do_lint; } sub register_plugin { my ( undef, $plugin, $new_checks ) = @_; - + # Register the plugin for my $check ( @$new_checks ) { defined $check @@ -471,12 +471,12 @@ sub register_plugin { or warn "$check is already registered as a B::Lint feature."; not $plugin_valid_check{ $check } or warn "$check is already registered as a $plugin_valid_check{$check} feature."; - + $plugin_valid_check{$check} = $plugin; } - + push @plugins, $plugin; - + return; } |