File Coverage

blib/lib/Template/Plugin/CaseVMethods.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 0 4 0.0
total 24 28 85.7


line stmt bran cond sub pod time code
1             package Template::Plugin::CaseVMethods;
2 1     1   61608 use Template::Plugin::VMethods;
  1         2873  
  1         6  
3 1     1   33 use base qw(Template::Plugin::VMethods);
  1         2  
  1         56  
4              
5 1     1   15 use strict;
  1         2  
  1         24  
6             #use warnings;
7              
8 1     1   3 use vars qw($VERSION @SCALAR_OPS);
  1         2  
  1         152  
9             $VERSION = 0.01;
10              
11 1     1 0 284 sub uppercase { uc $_[0] }
12 1     1 0 3271 sub lowercase { lc $_[0] }
13 1     1 0 3615 sub uppercase_first { ucfirst $_[0] }
14 1     1 0 2893 sub lowercase_first { lcfirst $_[0] }
15              
16             @SCALAR_OPS = ( "uc" => \&uppercase,
17             "lc" => \&lowercase,
18             "ucfirst" => \&uppercase_first,
19             "lcfirst" => \&lowercase_first, );
20              
21             =head1 NAME
22              
23             Template::Plugin::CaseVMethods - uppercase and lowercase letters
24              
25             =head1 SYNOPSIS
26              
27             [% USE CaseVMethods %]
28              
29             Hello [% name.ucfirst %].
30             ...or should I say...
31             HEY [% name.uc %] PAY ATTENTION I'M SPEAKING TO YOU.
32              
33             =head1 DESCRIPTION
34              
35             Provides four vmethods (uc, ucfirst, lc, lcfirst) that perform the
36             same actions as their Perl counterparts (return the string in
37             uppercase, return the string as is but with the first letter
38             capitalised, return the string in lower case, and return the string as
39             is but with the first letter lowercased.)
40              
41             =head1 AUTHOR
42              
43             Written by Mark Fowler Emark@twoshortplanks.comE
44              
45             Copyright Profero 2003. All Rights Reserved.
46              
47             This program is free software; you can redistribute it
48             and/or modify it under the same terms as Perl itself.
49              
50             =head1 BUGS
51              
52             None known.
53              
54             The tests might fail on locales where uppercase "z" isn't "Z" (and
55             vice versa) but the module will do the right thing (where the right
56             thing is defined as what your perl does.)
57              
58             Bugs should be reported to the open source development team
59             at Profero via the CPAN RT system.
60              
61             L.
62              
63             =head1 SEE ALSO
64              
65             L
66              
67             =cut
68              
69             1;