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.001.
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 opcodes (or AST:
50 abstract syntax tree) using the "B" module. See also "B" and its
51 submodules.
52
54 Perl 5.10.0 or later.
55
57 All complex software has bugs lurking in it, and this module is no
58 exception. If you find a bug please either email me, or add the bug to
59 cpan-RT.
60
62 Perl::Critic
63
64 warnings::unused
65
66 B
67
68 Test::Builder::Module
69
71 Goro Fuji (gfx) <gfuji(at)cpan.org>
72
74 Copyright (c) 2010, Goro Fuji (gfx). All rights reserved.
75
76 This library is free software; you can redistribute it and/or modify it
77 under the same terms as Perl itself. See perlartistic for details.
78
79
80
81perl v5.12.3 2010-03-12 Test::Vars(3)