X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=blobdiff_plain;f=lib%2Findirect.pm;h=fd488e78c91a093159e9346d389fa5c9872f8f98;hp=20827b4f1f8df116213b1801bdf71dd4d935726a;hb=a35bc34a3dbaebb6510df744d87151739d951578;hpb=87becaf886eef8f6bc23f318b0a94715fdcb7854 diff --git a/lib/indirect.pm b/lib/indirect.pm index 20827b4..fd488e7 100644 --- a/lib/indirect.pm +++ b/lib/indirect.pm @@ -1,6 +1,6 @@ package indirect; -use 5.008001; +use 5.008_001; use strict; use warnings; @@ -11,13 +11,13 @@ indirect - Lexically warn about using the indirect method call syntax. =head1 VERSION -Version 0.29 +Version 0.36 =cut our $VERSION; BEGIN { - $VERSION = '0.29'; + $VERSION = '0.36'; } =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. @@ -260,7 +280,7 @@ L 5.8.1. A C compiler. This module may happen to build with a C++ compiler as well, but don't rely on it, as no guarantee is made in this regard. -L (standard since perl 5), L (since perl 5.006). +L (standard since perl 5), L (since perl 5.6.0). =head1 AUTHOR @@ -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 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.