blib/lib/CGI/FormBuilder/Messages/base.pm untested

filter: Statementstmt 0.0% 0 / 25 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 36 SCAR 24.8
CC
3
Cov
0%
define_messages
6.0
messages
6.0
BEGIN
2.0
CRAP 12.0
1  
2 ###########################################################################
3 # Copyright (c) Nate Wiger http://nateware.com. All Rights Reserved.
4 # Please visit http://formbuilder.org for tutorials, support, and examples.
5 ###########################################################################
6  
7 package CGI::FormBuilder::Messages::base;
8  
9 use strict;
10 use utf8;
11  
12 our $VERSION = '3.10';
13 our %MESSAGES = ();
14  
15 sub define_messages {
16 my $class = shift;
17 my %hash = ref($_[0]) eq 'HASH' ? %{$_[0]} : @_;
18 while(my($k,$v) = each %hash) {
19 $MESSAGES{$k} = $v; # support inheritance
20 }
21 {
22 no strict 'refs';
23 while(my($k,$v) = each %MESSAGES) {
24 *{$k} = sub { $v };
25 }
26 }
27 }
28  
29 # This method should remain unchanged
30 sub messages {
31 return wantarray ? %MESSAGES : \%MESSAGES;
32 }
33  
34 1;
35 __END__