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
|
|
59
|
use strict; |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
432
|
|
10
|
11
|
|
|
11
|
|
53
|
use utf8; |
|
11
|
|
|
|
|
184
|
|
|
11
|
|
|
|
|
55
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '3.09'; |
13
|
|
|
|
|
|
|
our %MESSAGES = (); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub define_messages { |
16
|
20
|
|
|
20
|
0
|
48
|
my $class = shift; |
17
|
20
|
50
|
|
|
|
102
|
my %hash = ref($_[0]) eq 'HASH' ? %{$_[0]} : @_; |
|
20
|
|
|
|
|
408
|
|
18
|
20
|
|
|
|
|
159
|
while(my($k,$v) = each %hash) { |
19
|
752
|
|
|
|
|
2209
|
$MESSAGES{$k} = $v; # support inheritance |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
{ |
22
|
11
|
|
|
11
|
|
2123
|
no strict 'refs'; |
|
11
|
|
|
|
|
25
|
|
|
11
|
|
|
|
|
1456
|
|
|
20
|
|
|
|
|
35
|
|
23
|
20
|
|
|
|
|
97
|
while(my($k,$v) = each %MESSAGES) { |
24
|
800
|
|
|
0
|
|
11694
|
*{$k} = sub { $v }; |
|
800
|
|
|
|
|
6626
|
|
|
0
|
|
|
|
|
0
|
|
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# This method should remain unchanged |
30
|
|
|
|
|
|
|
sub messages { |
31
|
149
|
50
|
|
149
|
0
|
9983
|
return wantarray ? %MESSAGES : \%MESSAGES; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
__END__ |