X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=blobdiff_plain;f=lib%2Findirect.pm;h=295119fa41cde30825c0cc1f92f32bd33316b322;hp=8cbb750b7ba555bb8a181a6e3afad7c70925f4f2;hb=37b15f07544d0e184d4865fd7f9332f8e616b02e;hpb=76861cbb848c770203b09f413c9c65ca58c808c8 diff --git a/lib/indirect.pm b/lib/indirect.pm index 8cbb750..295119f 100644 --- a/lib/indirect.pm +++ b/lib/indirect.pm @@ -11,13 +11,13 @@ indirect - Lexically warn about using the indirect method call syntax. =head1 VERSION -Version 0.30 +Version 0.38 =cut our $VERSION; BEGIN { - $VERSION = '0.30'; + $VERSION = '0.38'; } =head1 SYNOPSIS @@ -56,7 +56,7 @@ Global uses : When enabled, this pragma warns about indirect method calls that are present in your code. The indirect syntax is now considered harmful, since its parsing has many quirks and its use is error prone : when the subroutine C has not been declared in the current package, C actually compiles to C<< $x->foo >>, and C<< foo { key => 1 } >> to C<< 'key'->foo(1) >>. -In L, Matt S. Trout gives an example of an undesirable indirect method call on a block that can cause a particularly bewildering error. +Please refer to the L section for a more complete list of reasons for avoiding this construct. This pragma currently does not warn for core functions (C, C, C or C). This may change in the future, or may be added as optional features that would be enabled by passing options to C. @@ -253,6 +253,26 @@ This is due to a shortcoming in the way perl handles the hints hash, which is ad The search for indirect method calls happens before constant folding. Hence C will be caught. +=head1 REFERENCES + +Numerous articles have been written about the quirks of the indirect object construct : + +=over 4 + +=item * + +L : B, Tom Christiansen, 1998-01-28. + +This historical post to the C mailing list raised awareness about the perils of this syntax. + +=item * + +L : B, Matt S. Trout, 2009-07-29. + +In this blog post, the author gives an example of an undesirable indirect method call on a block that causes a particularly bewildering error. + +=back + =head1 DEPENDENCIES L 5.8.1. @@ -264,7 +284,7 @@ L (standard since perl 5), L (since perl 5.6.0). =head1 AUTHOR -Vincent Pit, C<< >>, L. +Vincent Pit C<< >>. You can contact me by mail or on C (vincent). @@ -279,8 +299,6 @@ You can find documentation for this module with the perldoc command. perldoc indirect -Tests code coverage report is available at L. - =head1 ACKNOWLEDGEMENTS Bram, for motivation and advices. @@ -289,7 +307,7 @@ Andrew Main and Florian Ragwitz, for testing on real-life code and reporting iss =head1 COPYRIGHT & LICENSE -Copyright 2008,2009,2010,2011,2012,2013 Vincent Pit, all rights reserved. +Copyright 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2019 Vincent Pit, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.