1Test::Vars(3) User Contributed Perl Documentation Test::Vars(3)
2
3
4
6 Test::Vars - Detects unused variables
7
9 This document describes Test::Vars version 0.005.
10
12 use Test::Vars;
13
14 all_vars_ok(); # check libs in MANIFEST
15
17 Test::Vars finds unused variables in order to keep the source code
18 tidy.
19
21 Exported
22 all_vars_ok(%args)
23
24 Tests libraries in your distribution with %args.
25
26 libraries are collected from the MANIFEST file.
27
28 If you want to ignore variables, for example $foo, you can tell it to
29 the test routines:
30
31 "ignore_vars => { '$foo' => 1 }"
32 "ignore_vars => [qw($foo)]"
33 "ignore_if => sub{ $_ eq '$foo' }"
34
35 Note that $self will be ignored by default unless you pass explicitly
36 "{ '$self' => 0 }" to "ignore_vars".
37
38 vars_ok($lib, %args)
39
40 Tests $lib with %args.
41
42 See "all_vars_ok".
43
45 "Test::Vars" is similar to a part of "Test::Perl::Critic",but the
46 mechanism is different.
47
48 While "Perl::Critic", the backend of "Test::Perl::Critic", scans the
49 source code as texts, this modules scans the compiled opcode (or AST:
50 abstract syntax tree) using the "B" module. See also "B" and its
51 submodules.
52
54 "TEST_VERBOSE = 1 | 2 " shows the way this module works.
55
57 https://rt.cpan.org/Ticket/Display.html?id=60018
58
59 https://rt.cpan.org/Ticket/Display.html?id=82411
60
62 Perl 5.10.0 or later.
63
65 All complex software has bugs lurking in it, and this module is no
66 exception. If you find a bug please either email me, or add the bug to
67 cpan-RT.
68
70 Perl::Critic
71
72 warnings::unused
73
74 B
75
76 Test::Builder::Module
77
79 Goro Fuji (gfx) <gfuji(at)cpan.org>
80
82 Copyright (c) 2010, Goro Fuji (gfx). All rights reserved.
83
84 This library is free software; you can redistribute it and/or modify it
85 under the same terms as Perl itself. See perlartistic for details.
86
87
88
89perl v5.16.3 2014-06-10 Test::Vars(3)