File Coverage

blib/lib/Switch/Perlish/Smatch/Code.pm
Criterion Covered Total %
statement 20 20 100.0
branch n/a
condition n/a
subroutine 9 9 100.0
pod n/a
total 29 29 100.0


line stmt bran cond sub pod time code
1             package Switch::Perlish::Smatch::Code;
2              
3             $VERSION = '1.0.0';
4              
5 11     11   64 use strict;
  11         22  
  11         405  
6 11     11   61 use warnings;
  11         21  
  11         4564  
7              
8             ## DESC - Call $t with $m.
9             sub _VALUE {
10 4     4   5 my($t, $m) = @_;
11 4         11 return $t->($m);
12             }
13              
14             ## DESC - Call $t with $m.
15             *_UNDEF = \&_VALUE;
16              
17             ## DESC - Check if $m refers to $t.
18             sub _SCALAR {
19 2     2   4 my($t, $m) = @_;
20 2         28 return $t == $$m;
21             }
22              
23             ## DESC - Pass @$m to $t.
24             sub _ARRAY {
25 2     2   4 my($t, $m) = @_;
26 2         8 return $t->(@$m);
27             }
28              
29             ## DESC - Pass %$m to $t.
30             sub _HASH {
31 2     2   4 my($t, $m) = @_;
32 2         11 return $t->(%$m);
33             }
34              
35             ## DESC - Pass $m to $t.
36             sub _CODE {
37 2     2   5 my($t, $m) = @_;
38 2         5 return $t->($m);
39             }
40              
41             ## DESC - Pass $m to $t.
42             sub _OBJECT {
43 2     2   4 my($t, $m) = @_;
44 2         7 return $t->($m);
45             }
46              
47             ## DESC - Pass $m to $t.
48             sub _Regexp {
49 2     2   4 my($t, $m) = @_;
50 2         55 return $t->($m);
51             }
52              
53             Switch::Perlish::Smatch->register_package( __PACKAGE__, 'CODE' );
54              
55             1;
56              
57             =pod
58              
59             =head1 NAME
60              
61             Switch::Perlish::Smatch::Code - The C comparatory category package.
62              
63             =head1 VERSION
64              
65             1.0.0 - Initial release.
66              
67             =head1 DESCRIPTION
68              
69             This package provides the default implementation for the C comparator
70             category. For more information on the comparator implementation see.
71             L.
72              
73             =head1 SEE. ALSO
74              
75             L
76              
77             L
78              
79             =head1 AUTHOR
80              
81             Dan Brook C<< >>
82              
83             =head1 COPYRIGHT
84              
85             Copyright (c) 2006, Dan Brook. All Rights Reserved. This module is free
86             software. It may be used, redistributed and/or modified under the same
87             terms as Perl itself.
88              
89             =cut