diff options
author | Chip Salzenberg <chip@pobox.com> | 1998-07-04 16:51:36 -0400 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-07-05 04:15:25 +0000 |
commit | 56f7f34be21c292a158b632263ab6132603bb8ec (patch) | |
tree | 5267af4e955b2a31bf4ec6d7a0ebf9b37bf6027d /pod | |
parent | ebc74a4b06212bfe375379cdb78fad2ae96bd799 (diff) | |
download | perl-56f7f34be21c292a158b632263ab6132603bb8ec.tar.gz |
added patch with tweak to doc
Message-ID: <19980704205136.A16319@perlsupport.com>
Subject: [PATCH _69] Take 2: Warn on C<sub log; log($msg)>
p4raw-id: //depot/perl@1317
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perldiag.pod | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 3851bacfd0..7c8ab3d482 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -1759,7 +1759,7 @@ will extend the buffer and zero pad the new area. (S) An internal warning that the grammar is screwed up. -=item Operation `%s': no method found,%s +=item Operation `%s': no method found, %s (F) An attempt was made to perform an overloaded operation for which no handler was defined. While some handlers can be autogenerated in @@ -2358,6 +2358,21 @@ may break this. eval "sub name { ... }"; } +=item Subroutine %s hidden by keyword; use ampersand + +(W) You are trying to call a subroutine that has the same name as a +keyword. However, because the subroutine is not imported and +you're not using an ampersand, Perl won't call the subroutine. + +To force a subroutine call, either put an ampersand before the +subroutine name, or qualify the name with its package. Alternatively, +you can import the subroutine (or pretend that it's imported with the +C<use subs> pragma). + +If the Perl operator is what you want, then eliminate this warning by +using the CORE:: prefix on the operator (e.g. CORE::log($x)) or by +declaring the subroutine to be an object method (see L<attrs>). + =item Substitution loop (P) The substitution was looping infinitely. (Obviously, a |