]> git.vpit.fr Git - perl/modules/indirect.git/blob - README
This is 0.11
[perl/modules/indirect.git] / README
1 NAME
2     indirect - Lexically warn about using the indirect object syntax.
3
4 VERSION
5     Version 0.11
6
7 SYNOPSIS
8         no indirect;
9         my $x = new Apple 1, 2, 3; # warns
10         {
11          use indirect;
12          my $y = new Pear; # ok
13         }
14         no indirect ':fatal';
15         if (defied $foo) { ... } # croaks, note the typo
16
17 DESCRIPTION
18     When enabled (or disabled as some may prefer to say, since you actually
19     turn it on by calling "no indirect"), this pragma warns about indirect
20     object syntax constructs that may have slipped into your code. This
21     syntax is now considered harmful, since its parsing has many quirks and
22     its use is error prone (when "sub" isn't defined, "sub $x" is actually
23     interpreted as "$x->sub").
24
25     It currently does not warn when the object is enclosed between braces
26     (like "meth { $obj } @args") or for core functions ("print" or "say").
27     This may change in the future, or may be added as optional features that
28     would be enabled by passing options to "unimport".
29
30     This module is not a source filter.
31
32 METHODS
33   "unimport @opts"
34     Magically called when "no indirect @opts" is encountered. Turns the
35     module on. If @opts contains ':fatal', the module will croak on the
36     first indirect syntax met.
37
38   "import"
39     Magically called at each "use indirect". Turns the module off.
40
41 CAVEATS
42     "meth $obj" (no semicolon) at the end of a file won't be seen as an
43     indirect object syntax, although it will as soon as there is another
44     token before the end (as in "meth $obj;" or "meth $obj 1").
45
46     With 5.8 perls, the pragma does not propagate into "eval STRING". This
47     is due to a shortcoming in the way perl handles the hints hash, which is
48     addressed in perl 5.10.
49
50 DEPENDENCIES
51     perl 5.8.
52
53     XSLoader (standard since perl 5.006).
54
55 AUTHOR
56     Vincent Pit, "<perl at profvince.com>", <http://www.profvince.com>.
57
58     You can contact me by mail or on "irc.perl.org" (vincent).
59
60 BUGS
61     Please report any bugs or feature requests to "bug-indirect at
62     rt.cpan.org", or through the web interface at
63     <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=indirect>. I will be
64     notified, and then you'll automatically be notified of progress on your
65     bug as I make changes.
66
67 SUPPORT
68     You can find documentation for this module with the perldoc command.
69
70         perldoc indirect
71
72     Tests code coverage report is available at
73     <http://www.profvince.com/perl/cover/indirect>.
74
75 ACKNOWLEDGEMENTS
76     Bram, for motivation and advices.
77
78 COPYRIGHT & LICENSE
79     Copyright 2008-2009 Vincent Pit, all rights reserved.
80
81     This program is free software; you can redistribute it and/or modify it
82     under the same terms as Perl itself.
83