|
|
|
@ -53,6 +53,24 @@ sub set {
|
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sub parse_format_line { |
|
|
|
|
my ($self, $line) = @_; |
|
|
|
|
|
|
|
|
|
return unless $line and $line =~ m{^Format:}oi; |
|
|
|
|
|
|
|
|
|
chomp $line; |
|
|
|
|
$line =~ s{^Format:\s+}{}oi; |
|
|
|
|
|
|
|
|
|
my @fields; |
|
|
|
|
foreach my $field (split(/,\s*/o, $line)) { |
|
|
|
|
$field = lc($field); |
|
|
|
|
return unless exists $FIELDS{$field}; |
|
|
|
|
push @fields, $field; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return [ @fields ]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
# formats: |
|
|
|
|
# s - string, use as is |
|
|
|
|
# d - decimal, no-zero pad |
|
|
|
|