line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::SuperForm; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
58100
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
4
|
1
|
|
|
1
|
|
692
|
use HTML::SuperForm::Field; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
34
|
|
5
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2127
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = 1.06; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my %fields = map { $_ => 1 } qw(textarea text checkbox select radio checkbox_group radio_group password hidden submit); |
10
|
|
|
|
|
|
|
my %mutators = map { $_ => 1 } qw(well_formed sticky fallback values_as_labels); |
11
|
|
|
|
|
|
|
my %accessors = map { $_ => 1 } qw(field_object params); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
15
|
0
|
|
|
|
|
|
my $arg = shift; |
16
|
0
|
|
0
|
|
|
|
my $field_object = shift || "HTML::SuperForm::Field"; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
my $params = {}; |
19
|
0
|
|
|
|
|
|
my $method = $ENV{REQUEST_METHOD}; |
20
|
0
|
|
|
|
|
|
my $content_type = $ENV{CONTENT_TYPE}; |
21
|
0
|
|
|
|
|
|
my $parameters_from = ''; |
22
|
|
|
|
|
|
|
|
23
|
0
|
0
|
0
|
|
|
|
if(UNIVERSAL::isa($arg, "Apache") && eval("require Apache::Request")) { |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
my $apr; |
25
|
0
|
0
|
|
|
|
|
if(UNIVERSAL::isa($arg, "Apache::Request")) { |
26
|
0
|
|
|
|
|
|
$apr = $arg; |
27
|
|
|
|
|
|
|
} else { |
28
|
0
|
|
|
|
|
|
$apr = Apache::Request->instance($arg); |
29
|
|
|
|
|
|
|
} |
30
|
0
|
|
|
|
|
|
my @ps = $apr->param(); |
31
|
0
|
|
|
|
|
|
for my $p (@ps) { |
32
|
0
|
|
|
|
|
|
my @values = $apr->param($p); |
33
|
|
|
|
|
|
|
|
34
|
0
|
0
|
|
|
|
|
if(scalar(@values) > 1) { |
35
|
0
|
|
|
|
|
|
$params->{$p} = \@values; |
36
|
|
|
|
|
|
|
} else { |
37
|
0
|
|
|
|
|
|
$params->{$p} = $values[0]; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
} |
40
|
0
|
|
|
|
|
|
$parameters_from = 'Apache::Request'; |
41
|
|
|
|
|
|
|
} elsif(UNIVERSAL::isa($arg, "Apache2::RequestRec") && eval("require Apache2::Request")) { |
42
|
0
|
|
|
|
|
|
my $apr; |
43
|
0
|
0
|
|
|
|
|
if(UNIVERSAL::isa($arg, "Apache2::Request")) { |
44
|
0
|
|
|
|
|
|
$apr = $arg; |
45
|
|
|
|
|
|
|
} else { |
46
|
0
|
|
|
|
|
|
$apr = Apache2::Request->new($arg); |
47
|
|
|
|
|
|
|
} |
48
|
0
|
|
|
|
|
|
my @ps = $apr->param(); |
49
|
0
|
|
|
|
|
|
for my $p (@ps) { |
50
|
0
|
|
|
|
|
|
my @values = $apr->param($p); |
51
|
|
|
|
|
|
|
|
52
|
0
|
0
|
|
|
|
|
if(scalar(@values) > 1) { |
53
|
0
|
|
|
|
|
|
$params->{$p} = \@values; |
54
|
|
|
|
|
|
|
} else { |
55
|
0
|
|
|
|
|
|
$params->{$p} = $values[0]; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
} |
58
|
0
|
|
|
|
|
|
$parameters_from = 'Apache2::Request'; |
59
|
|
|
|
|
|
|
} elsif(ref($arg) eq "HASH") { |
60
|
0
|
|
|
|
|
|
$params = $arg; |
61
|
0
|
|
|
|
|
|
$parameters_from = 'hash reference'; |
62
|
|
|
|
|
|
|
} elsif(UNIVERSAL::isa($arg, "CGI")) { |
63
|
0
|
|
|
|
|
|
my $vars = $arg->Vars(); |
64
|
0
|
|
|
|
|
|
for my $key (keys %$vars) { |
65
|
0
|
0
|
|
|
|
|
if($vars->{$key} =~ /\0/) { |
66
|
0
|
|
|
|
|
|
$params->{$key} = [ split('\0', $vars->{$key}) ]; |
67
|
|
|
|
|
|
|
} else { |
68
|
0
|
|
|
|
|
|
$params->{$key} = $vars->{$key}; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
} |
71
|
0
|
|
|
|
|
|
$parameters_from = 'CGI'; |
72
|
|
|
|
|
|
|
} elsif($ENV{CONTENT_TYPE} eq 'application/x-www-form-urlencoded') { |
73
|
0
|
|
|
|
|
|
my $query = $ENV{QUERY_STRING}; |
74
|
|
|
|
|
|
|
|
75
|
0
|
|
|
|
|
|
my @pairs = split(/[&;]/, $query); |
76
|
|
|
|
|
|
|
|
77
|
0
|
0
|
|
|
|
|
if($method eq 'POST') { |
78
|
0
|
|
|
|
|
|
my $len = $ENV{CONTENT_LENGTH}; |
79
|
0
|
|
|
|
|
|
my $pquery; |
80
|
0
|
|
|
|
|
|
sysread STDIN, $pquery, $len; |
81
|
|
|
|
|
|
|
|
82
|
0
|
|
|
|
|
|
push(@pairs, split(/[&;]/, $pquery)); |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
0
|
|
|
|
|
|
for my $pair (@pairs) { |
86
|
0
|
|
|
|
|
|
my ($key, $value) = split('=', $pair); |
87
|
0
|
|
|
|
|
|
$key =~ tr/+/ /; |
88
|
0
|
|
|
|
|
|
$key =~ s/%([0-9A-Za-z]{2})/chr(hex($1))/ge; |
|
0
|
|
|
|
|
|
|
89
|
0
|
|
|
|
|
|
$value =~ tr/+/ /; |
90
|
0
|
|
|
|
|
|
$value =~ s/%([0-9A-Za-z]{2})/chr(hex($1))/ge; |
|
0
|
|
|
|
|
|
|
91
|
0
|
0
|
|
|
|
|
if(exists($params->{$key})) { |
92
|
0
|
0
|
|
|
|
|
if(ref($params->{$key}) eq "ARRAY") { |
93
|
0
|
|
|
|
|
|
push(@{$params->{$key}}, $value); |
|
0
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
} else { |
95
|
0
|
|
|
|
|
|
$params->{$key} = [ $params->{$key}, $value ]; |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
} else { |
98
|
0
|
|
|
|
|
|
$params->{$key} = $value; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
} |
101
|
0
|
|
|
|
|
|
$parameters_from = 'ENV'; |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
|
my $self = { |
105
|
|
|
|
|
|
|
_params => $params, |
106
|
|
|
|
|
|
|
_method => $method, |
107
|
|
|
|
|
|
|
_sticky => 0, |
108
|
|
|
|
|
|
|
_fallback => 0, |
109
|
|
|
|
|
|
|
_well_formed => 1, |
110
|
|
|
|
|
|
|
_values_as_labels => 1, |
111
|
|
|
|
|
|
|
_field_object => $field_object, |
112
|
|
|
|
|
|
|
_attributes => { |
113
|
|
|
|
|
|
|
method => "POST" |
114
|
|
|
|
|
|
|
}, |
115
|
|
|
|
|
|
|
_other_info => {}, |
116
|
|
|
|
|
|
|
_parameters_from => $parameters_from |
117
|
|
|
|
|
|
|
}; |
118
|
|
|
|
|
|
|
|
119
|
0
|
|
|
|
|
|
bless $self, $class; |
120
|
|
|
|
|
|
|
|
121
|
0
|
|
|
|
|
|
return $self; |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub name { |
125
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
126
|
0
|
|
|
|
|
|
return $self->{_attributes}{name}; |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
sub set { |
130
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
131
|
|
|
|
|
|
|
|
132
|
0
|
|
|
|
|
|
my %hash; |
133
|
|
|
|
|
|
|
|
134
|
0
|
0
|
|
|
|
|
if(ref($_[0]) eq "HASH") { |
135
|
0
|
|
|
|
|
|
%hash = %{ shift() }; |
|
0
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
} else { |
137
|
0
|
|
|
|
|
|
%hash = @_; |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
|
140
|
0
|
|
|
|
|
|
$self->{_other_info} = { |
141
|
0
|
|
|
|
|
|
%{$self->{_other_info}}, |
142
|
|
|
|
|
|
|
%hash, |
143
|
|
|
|
|
|
|
}; |
144
|
|
|
|
|
|
|
|
145
|
0
|
|
|
|
|
|
return; |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
sub get { |
149
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
150
|
|
|
|
|
|
|
|
151
|
0
|
|
|
|
|
|
my @return; |
152
|
|
|
|
|
|
|
|
153
|
0
|
|
|
|
|
|
for my $key (@_) { |
154
|
0
|
0
|
|
|
|
|
if(exists($self->{_other_info}{$key})) { |
155
|
0
|
|
|
|
|
|
push(@return, $self->{_other_info}{$key}); |
156
|
|
|
|
|
|
|
} else { |
157
|
0
|
|
|
|
|
|
carp "WARNING: nothing stored under key $key"; |
158
|
|
|
|
|
|
|
} |
159
|
|
|
|
|
|
|
} |
160
|
|
|
|
|
|
|
|
161
|
0
|
0
|
|
|
|
|
return wantarray ? @return : |
|
|
0
|
|
|
|
|
|
162
|
|
|
|
|
|
|
scalar(@return) == 1 ? $return[0] : \@return; |
163
|
|
|
|
|
|
|
} |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
sub start_form { |
166
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
167
|
|
|
|
|
|
|
|
168
|
0
|
|
|
|
|
|
my $config = {}; |
169
|
|
|
|
|
|
|
|
170
|
0
|
0
|
|
|
|
|
if(ref($_[0]) eq "HASH") { |
171
|
0
|
|
|
|
|
|
$config = shift; |
172
|
|
|
|
|
|
|
} else { |
173
|
0
|
|
|
|
|
|
%$config = @_; |
174
|
|
|
|
|
|
|
} |
175
|
|
|
|
|
|
|
|
176
|
0
|
|
|
|
|
|
$self->{_attributes} = { |
177
|
0
|
|
|
|
|
|
%{$self->{_attributes}}, |
178
|
|
|
|
|
|
|
%$config, |
179
|
|
|
|
|
|
|
}; |
180
|
|
|
|
|
|
|
|
181
|
0
|
|
|
|
|
|
my $tag = " |
182
|
|
|
|
|
|
|
|
183
|
0
|
|
|
|
|
|
my $attrib_str = join(' ', map { qq|$_="$self->{_attributes}{$_}"| } |
|
0
|
|
|
|
|
|
|
184
|
0
|
|
|
|
|
|
keys %{$self->{_attributes}}); |
185
|
|
|
|
|
|
|
|
186
|
0
|
0
|
|
|
|
|
$tag .= " $attrib_str" if $attrib_str; |
187
|
0
|
|
|
|
|
|
$tag .= ">"; |
188
|
|
|
|
|
|
|
|
189
|
0
|
0
|
|
|
|
|
if(lc($self->{_attributes}{method}) eq lc($self->{_method})) { |
190
|
0
|
|
|
|
|
|
$self->set_sticky(1); |
191
|
|
|
|
|
|
|
} |
192
|
|
|
|
|
|
|
|
193
|
0
|
|
|
|
|
|
return $tag; |
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
sub end_form { |
197
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
198
|
|
|
|
|
|
|
|
199
|
0
|
|
|
|
|
|
return ""; |
200
|
|
|
|
|
|
|
} |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
sub set_sticky { |
203
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
204
|
0
|
|
|
|
|
|
$self->sticky(shift); |
205
|
|
|
|
|
|
|
} |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
sub no_of_fields { |
208
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
209
|
0
|
|
|
|
|
|
my $name = shift; |
210
|
|
|
|
|
|
|
|
211
|
0
|
0
|
|
|
|
|
if(exists($self->{_defaults}{$name})) { |
212
|
0
|
0
|
|
|
|
|
if(ref($self->{_defaults}{$name}) eq "ARRAY") { |
213
|
0
|
|
|
|
|
|
return scalar(@{$self->{_defaults}{$name}}); |
|
0
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
} else { |
215
|
0
|
|
|
|
|
|
return 1; |
216
|
|
|
|
|
|
|
} |
217
|
|
|
|
|
|
|
} |
218
|
0
|
|
|
|
|
|
return 0; |
219
|
|
|
|
|
|
|
} |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
sub trim_params { |
222
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
223
|
|
|
|
|
|
|
|
224
|
0
|
|
|
|
|
|
for my $key (keys %{$self->{_params}}) { |
|
0
|
|
|
|
|
|
|
225
|
0
|
|
|
|
|
|
$self->{_params}{$key} =~ s/^\s+//; |
226
|
0
|
|
|
|
|
|
$self->{_params}{$key} =~ s/\s+$//; |
227
|
|
|
|
|
|
|
} |
228
|
|
|
|
|
|
|
} |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
sub param { |
231
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
232
|
|
|
|
|
|
|
|
233
|
0
|
0
|
|
|
|
|
if(ref($_[0]) eq "HASH") { |
|
|
0
|
|
|
|
|
|
234
|
0
|
|
|
|
|
|
for my $key (keys %{$_[0]}) { |
|
0
|
|
|
|
|
|
|
235
|
0
|
|
|
|
|
|
$self->{_params}{$key} = $_[0]->{$key}; |
236
|
|
|
|
|
|
|
} |
237
|
0
|
|
|
|
|
|
return; |
238
|
|
|
|
|
|
|
} elsif(scalar(@_) > 1) { |
239
|
0
|
|
|
|
|
|
my %hash = @_; |
240
|
0
|
|
|
|
|
|
for my $key (keys %hash) { |
241
|
0
|
|
|
|
|
|
$self->{_params}{$key} = $hash{$key}; |
242
|
|
|
|
|
|
|
} |
243
|
0
|
|
|
|
|
|
return; |
244
|
|
|
|
|
|
|
} |
245
|
|
|
|
|
|
|
|
246
|
0
|
|
|
|
|
|
return $self->{_params}{$_[0]}; |
247
|
|
|
|
|
|
|
} |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
sub add_default { |
250
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
251
|
|
|
|
|
|
|
|
252
|
0
|
|
|
|
|
|
my %hash; |
253
|
|
|
|
|
|
|
|
254
|
0
|
0
|
|
|
|
|
if(ref($_[0]) eq "HASH") { |
255
|
0
|
|
|
|
|
|
%hash = %{$_[0]}; |
|
0
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
} else { |
257
|
0
|
|
|
|
|
|
%hash = @_; |
258
|
|
|
|
|
|
|
} |
259
|
|
|
|
|
|
|
|
260
|
0
|
|
|
|
|
|
while(my ($key, $value) = each %hash) { |
261
|
0
|
0
|
|
|
|
|
if(exists($self->{_defaults}{$key})) { |
262
|
0
|
0
|
|
|
|
|
if(ref($self->{_defaults}{$key}) eq "ARRAY") { |
263
|
0
|
|
|
|
|
|
push(@{$self->{_defaults}{$key}}, $value); |
|
0
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
} else { |
265
|
0
|
|
|
|
|
|
$self->{_defaults}{$key} = [ $self->{_defaults}{$key}, $value ]; |
266
|
|
|
|
|
|
|
} |
267
|
|
|
|
|
|
|
} else { |
268
|
0
|
|
|
|
|
|
$self->{_defaults}{$key} = $value; |
269
|
|
|
|
|
|
|
} |
270
|
|
|
|
|
|
|
} |
271
|
|
|
|
|
|
|
|
272
|
0
|
|
|
|
|
|
return; |
273
|
|
|
|
|
|
|
} |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
sub defaults { |
276
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
277
|
|
|
|
|
|
|
|
278
|
0
|
|
|
|
|
|
my $defaults = {}; |
279
|
|
|
|
|
|
|
|
280
|
0
|
|
|
|
|
|
for my $key (keys %{$self->{_defaults}}) { |
|
0
|
|
|
|
|
|
|
281
|
0
|
0
|
|
|
|
|
if(ref($self->{_defaults}) eq "ARRAY") { |
282
|
0
|
|
|
|
|
|
$defaults->{$key} = [ @{$self->{_defaults}{$key}} ]; |
|
0
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
} else { |
284
|
0
|
|
|
|
|
|
$defaults->{$key} = $self->{_defaults}{$key}; |
285
|
|
|
|
|
|
|
} |
286
|
|
|
|
|
|
|
} |
287
|
|
|
|
|
|
|
|
288
|
0
|
|
|
|
|
|
return $defaults; |
289
|
|
|
|
|
|
|
} |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
sub set_default { |
292
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
293
|
|
|
|
|
|
|
|
294
|
0
|
|
|
|
|
|
my %hash; |
295
|
|
|
|
|
|
|
|
296
|
0
|
0
|
|
|
|
|
if(ref($_[0]) eq "HASH") { |
297
|
0
|
|
|
|
|
|
%hash = %{$_[0]}; |
|
0
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
} else { |
299
|
0
|
|
|
|
|
|
%hash = @_; |
300
|
|
|
|
|
|
|
} |
301
|
|
|
|
|
|
|
|
302
|
0
|
|
|
|
|
|
while( my ($key, $value) = each %hash) { |
303
|
0
|
|
|
|
|
|
$self->{_defaults}{$key} = $value; |
304
|
|
|
|
|
|
|
} |
305
|
|
|
|
|
|
|
|
306
|
0
|
|
|
|
|
|
return; |
307
|
|
|
|
|
|
|
} |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
sub exists_param { |
310
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
311
|
0
|
|
|
|
|
|
my $key = shift; |
312
|
|
|
|
|
|
|
|
313
|
0
|
|
|
|
|
|
return exists($self->{_params}{$key}); |
314
|
|
|
|
|
|
|
} |
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
sub AUTOLOAD { |
317
|
0
|
|
|
0
|
|
|
my $self = $_[0]; |
318
|
|
|
|
|
|
|
|
319
|
0
|
|
|
|
|
|
my ($key) = ${*AUTOLOAD} =~ /::([^:]*)$/; |
|
0
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
{ |
322
|
1
|
|
|
1
|
|
10
|
no strict "refs"; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
490
|
|
|
0
|
|
|
|
|
|
|
323
|
0
|
0
|
|
|
|
|
if(exists($fields{$key})) { |
324
|
0
|
|
|
|
|
|
my $field_name = ucfirst($key); |
325
|
0
|
|
|
|
|
|
$field_name =~ s/_(\w)/\U$1/g; |
326
|
|
|
|
|
|
|
|
327
|
0
|
|
|
|
|
|
my $object = $self->{_field_object} . "::" . $field_name; |
328
|
|
|
|
|
|
|
|
329
|
0
|
|
|
|
|
|
eval "require $object"; |
330
|
0
|
|
|
|
|
|
*{"HTML::SuperForm::$key"} = sub { |
331
|
0
|
|
|
0
|
|
|
return $object->new(@_); |
332
|
0
|
|
|
|
|
|
}; |
333
|
0
|
|
|
|
|
|
goto &{"HTML::SuperForm::$key"}; |
|
0
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
} |
335
|
|
|
|
|
|
|
|
336
|
0
|
0
|
|
|
|
|
if(exists($mutators{$key})) { |
337
|
0
|
|
|
|
|
|
*{"HTML::SuperForm::$key"} = sub { |
338
|
0
|
|
|
0
|
|
|
my $self = shift; |
339
|
0
|
|
|
|
|
|
my $val = shift; |
340
|
|
|
|
|
|
|
|
341
|
0
|
0
|
|
|
|
|
if(defined($val)) { |
342
|
0
|
|
|
|
|
|
$self->{'_' . $key} = $val; |
343
|
0
|
|
|
|
|
|
return; |
344
|
|
|
|
|
|
|
} |
345
|
0
|
|
|
|
|
|
return $self->{'_' . $key}; |
346
|
0
|
|
|
|
|
|
}; |
347
|
0
|
|
|
|
|
|
goto &{"HTML::SuperForm::$key"}; |
|
0
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
} |
349
|
|
|
|
|
|
|
|
350
|
0
|
0
|
|
|
|
|
if(exists($accessors{$key})) { |
351
|
0
|
|
|
|
|
|
*{"HTML::SuperForm::$key"} = sub { |
352
|
0
|
|
|
0
|
|
|
my $self = shift; |
353
|
0
|
|
|
|
|
|
return $self->{'_' . $key}; |
354
|
0
|
|
|
|
|
|
}; |
355
|
0
|
|
|
|
|
|
goto &{"HTML::SuperForm::$key"}; |
|
0
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
} |
357
|
|
|
|
|
|
|
|
358
|
0
|
0
|
|
|
|
|
if(exists($self->{attributes}{$key})) { |
359
|
0
|
|
|
|
|
|
*{"HTML::SuperForm::$key"} = sub { |
360
|
0
|
|
|
0
|
|
|
my $self = shift; |
361
|
0
|
|
|
|
|
|
return $self->{_attributes}{$key}; |
362
|
0
|
|
|
|
|
|
}; |
363
|
0
|
|
|
|
|
|
goto &{"HTML::SuperForm::$key"}; |
|
0
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
} else { |
365
|
0
|
|
|
|
|
|
croak "ERROR: attribute $key doesn't exist"; |
366
|
|
|
|
|
|
|
} |
367
|
|
|
|
|
|
|
} |
368
|
|
|
|
|
|
|
|
369
|
0
|
|
|
|
|
|
return; |
370
|
|
|
|
|
|
|
} |
371
|
|
|
|
|
|
|
|
372
|
0
|
|
|
0
|
|
|
sub DESTROY {} |
373
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
1; |
375
|
|
|
|
|
|
|
__END__ |