line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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
|
11
|
|
|
11
|
|
35
|
use strict; |
|
11
|
|
|
|
|
14
|
|
|
11
|
|
|
|
|
250
|
|
10
|
11
|
|
|
11
|
|
37
|
use utf8; |
|
11
|
|
|
|
|
106
|
|
|
11
|
|
|
|
|
39
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '3.10'; |
13
|
|
|
|
|
|
|
our %MESSAGES = (); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub define_messages { |
16
|
20
|
|
|
20
|
0
|
26
|
my $class = shift; |
17
|
20
|
50
|
|
|
|
61
|
my %hash = ref($_[0]) eq 'HASH' ? %{$_[0]} : @_; |
|
20
|
|
|
|
|
265
|
|
18
|
20
|
|
|
|
|
89
|
while(my($k,$v) = each %hash) { |
19
|
752
|
|
|
|
|
1089
|
$MESSAGES{$k} = $v; # support inheritance |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
{ |
22
|
11
|
|
|
11
|
|
1058
|
no strict 'refs'; |
|
11
|
|
|
|
|
11
|
|
|
11
|
|
|
|
|
1105
|
|
|
20
|
|
|
|
|
25
|
|
23
|
20
|
|
|
|
|
58
|
while(my($k,$v) = each %MESSAGES) { |
24
|
800
|
|
|
0
|
|
1038
|
*{$k} = sub { $v }; |
|
800
|
|
|
|
|
2506
|
|
|
0
|
|
|
|
|
0
|
|
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# This method should remain unchanged |
30
|
|
|
|
|
|
|
sub messages { |
31
|
149
|
50
|
|
149
|
0
|
2873
|
return wantarray ? %MESSAGES : \%MESSAGES; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
__END__ |