@ -32,7 +32,7 @@ sub new {
_type => 'ass',
_fields => \%FIELDS,
_format => \@FIELDS_ASS,
_prefix => 'Dialogue',
_prefix => qr/(Dialogue|Comment|Picture|Sound|Movie|Command)/,
};
if (my $t = $opts{type}) {
@ -64,6 +64,8 @@ sub parse {
my $PREFIX = $self->{_prefix};
return $self->error("not looks like $PREFIX line")
unless $line and $line =~ m{^$PREFIX:}i;
$self->{_prefix} = $1
if ref($self->{_prefix}) eq 'Regexp';
return $self->error("passed custom fields order not ARRAY ref")
unless $format and ref($format) eq 'ARRAY';