19 |
use re 'eval'; |
use re 'eval'; |
20 |
use vars qw(%OPTION %REG $VERSION); |
use vars qw(%OPTION %REG $VERSION); |
21 |
$VERSION=do{my @r=(q$Revision$=~/\d+/g);sprintf "%d."."%02d" x $#r,@r}; |
$VERSION=do{my @r=(q$Revision$=~/\d+/g);sprintf "%d."."%02d" x $#r,@r}; |
22 |
use overload '@{}' => sub {[shift->value]}, |
use overload '@{}' => sub {shift->value}, |
23 |
'""' => sub {shift->stringify}; |
'""' => sub {shift->stringify}; |
24 |
require Message::Util; |
require Message::Util; |
25 |
$REG{comment} = qr/\x28(?:\x5C[\x00-\xFF]|[\x00-\x0C\x0E-\x27\x2A-\x5B\x5D-\xFF]+|(??{$REG{comment}}))*\x29/; |
$REG{comment} = qr/\x28(?:\x5C[\x00-\xFF]|[\x00-\x0C\x0E-\x27\x2A-\x5B\x5D-\xFF]+|(??{$REG{comment}}))*\x29/; |
83 |
$self->{option}->{separator_long} = ', '; |
$self->{option}->{separator_long} = ', '; |
84 |
$self->{option}->{long_count} = 5; |
$self->{option}->{long_count} = 5; |
85 |
$self->{option}->{value_unsafe_rule} = 'NON_component'; |
$self->{option}->{value_unsafe_rule} = 'NON_component'; |
86 |
|
$self->{option}->{encoding_after_encode} = 'utf-8'; |
87 |
} elsif ($field_name eq 'distribution') { |
} elsif ($field_name eq 'distribution') { |
88 |
$self->{option}->{separator} = ','; |
$self->{option}->{separator} = ','; |
89 |
$self->{option}->{separator_long} = ', '; |
$self->{option}->{separator_long} = ', '; |
160 |
|
|
161 |
=head2 $self->value () |
=head2 $self->value () |
162 |
|
|
163 |
Returns value list. |
Returns array reference to value list. |
164 |
|
|
165 |
=cut |
=cut |
166 |
|
|
167 |
sub value ($) {@{shift->{value}}} |
sub value ($) {shift->{value}} |
168 |
|
|
169 |
=head2 $self->add ($value, [%option]) |
=head2 $self->add ($value, [%option]) |
170 |
|
|
243 |
$self->{option}->{$name}; |
$self->{option}->{$name}; |
244 |
} |
} |
245 |
|
|
246 |
|
sub value_type ($;$%) { |
247 |
|
my $self = shift; |
248 |
|
my $new_value_type = shift; |
249 |
|
if ($new_value_type) { |
250 |
|
$self->{option}->{value_type}->[0] = $new_value_type; |
251 |
|
} |
252 |
|
$self->{option}->{value_type}->[0] || ':none:'; |
253 |
|
} |
254 |
|
|
255 |
sub _delete_empty ($) { |
sub _delete_empty ($) { |
256 |
my $self = shift; |
my $self = shift; |
257 |
my @nid; |
my @nid; |